0% found this document useful (0 votes)
8 views

1. Number Systems - Notes

Uploaded by

Aradhyay Dwivedi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

1. Number Systems - Notes

Uploaded by

Aradhyay Dwivedi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Number Systems

Chapters:

1. Binary Represented Data


2. Binary, Denary & Hexadecimal Systems
3. Interconversion
4. Use of the Hexadecimal System
5. Addition of Binary Numbers
6. Logical Binary Shifts
7. Two’s Complement (Binary Numbers)

----------------------------------------------------------------------------------------------------------------------------------------------

1. Binary Represented Data

 Any Form of Data Needs to be Converted into a Binary Format so that it can be processed by the
Computer.
 The Basic Building Block in all Computers is the Binary Number System.
 Binary System only consists of 1s and 0s.
 Computers have millions and millions of tiny ‘switches’ with states of ‘On’ (Represented by 1s)
and ‘Off’ (Represented by 0s).

----------------------------------------------------------------------------------------------------------------------------------------------

2. Binary, Denary & Hexadecimal Systems

Binary Number System:

The Binary Number System is a Base 2 Number System.


Binary System only consists of 1s and 0s.

The Typical Headings for a Binary Number with 8 Digits would be:

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
Hexadecimal Number System:

The Binary Number System is a Base 16 Number System.


Binary System only consists of 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F.
A, B, C, D, E and F represent 10, 11, 12, 13, 14 and 15.

The Typical Headings for a Binary Number with 5 Digits would be:

164 163 162 161 160


65,536 4096 256 16 1

----------------------------------------------------------------------------------------------------------------------------------------------

3. Interconversion

Denary to Binary Conversion:

Steps: Step 5 – The Value is the Binary Value

Example:
Step 1 – Write Down the Denary Number

Step 2 – Write it in the form of a Sum of Power 627


of 2 with Co-Efficient equal to 1 or 0 only
512 + 64 + 32 + 16 + 2 + 1
Step 3 – Now Write the Sum into a Binary Table 29 + 0(28) + 0(27) + 26 + 25 + 24 + 0(23) + 0(22) + 21 + 20

29 28 27 26 25 24 23 22 21 20
1 0 0 1 1 1 0 0 1 1
Step 4 – Write Value in the Lower Row Altogether
1001110011

Binary to Denary Conversion:

Steps: Example:

Step 1 – Write Down the Binary Number 1001110011

Step 2 – Put it into a Binary Table 512 256 128 64 32 16 8 4 2 1


1 0 0 1 1 1 0 0 1 1

Step 3 – Multiply the Values in the Same Column 51 0 0 64 32 16 0 0 2 1


2
Step 4 – Add all Final Value

Step 5 – The Sum is the Value in Denary 512 + 0 + 0 + 64 + 32 + 16 + 0 + 0 + 2 + 1

62
Binary to Hexadecimal Conversion:

Steps: Example:

Step 1 – Write Down the Binary Number 10000111111101

Step 2 – Separate the Digits from Groups of 4 from 10|0001|1111|1101


the Back

Step 2.5 – If the Last Group (Left Most Group) doesn’t 0010|0001|1111|1101
have 4 digits, put 0s in front of it so that it
has 4 digits.

Step 3 – Write those Groups as Denary Numbers 2|1|15|13

Step 4 – Write those Groups as Hexadecimal 2|1|F|D

Step 5 – Write them as one. 21FD

Step 6 – The Value is the Hexadecimal Value.

Hexadecimal to Binary Conversion:

Steps: Example:

Step 1 – Write Down the Hexadecimal Number 21FD

Step 2 – Separate the Digits 2|1|F|D

Step 3 – Write those Groups as Denary Numbers 2|1|15|13

Step 4 – Write those Groups as Binary Numbers 0010|0001|1111|1101

Step 5 – Write them as one. 0010000111111101

Step 5.5 – Remove all the starting 0s such that 1 is 10000111111101


the First Number

Step 6 – The Value is the Binary Value.


Decimal to Hexadecimal Conversion:

Steps: Example:

Step 1 – Write Down the Denary Number 8701

Step 2 – Write it in the form of a Sum of Power 8192 + 256 + 240 + 13


of 16 with Co-Efficient equal to 0, 1, 2, 3, 4,
2 × 163|1 × 162| × 161|13 × 160
5, 6, 7, 8, 9, 10, 11, 12, 13, 14 or 15 only
163 162 161 160
Step 3 – Write the Sum into a Hexadecimal Table 2 1 15 13

Step 4 – Write Dinary Value in the Lower Row as 163 162 161 160
Hexadecimal Values 2 1 F D
Step 5 – Write the Values in the Final Row Altogether
21FD
Step 6 –The Values in the Final Hexadecimal Value

Hexadecimal to Decimal Conversion:

Steps: Example:

Step 1 – Write Down the Hexadecimal Number 21FD

Step 2 – Separate the Digits 2|1|F|D

Step 3 – Write those Groups as Denary Numbers 2|1|15|13

Step 4 – Multiply those Groups as 16x-1 where x 2 × 163|1 × 162|15 × 161|13 × 160
increases as it moves towards the left. 2 × 4096|1 × 256|15 × 16|13 × 1
8192|256|240|13

Step 5 – Add the Numbers Together. 8192 + 256 + 240 + 13

Step 6 – The Value is the Hexadecimal Value. 8701

----------------------------------------------------------------------------------------------------------------------------------------------

4. Use of Hexadecimal Values

Benefits of Hexadecimal:

 A Single Hexadecimal Digit is equivalent to 4 Binary Digits whereas a Single Denary Digit is only equivalent
to 3.32 Binary Digit
 Easier for Humans to Remember, Copy and Work with.
4 Uses of the Hexadecimal System:

 Error Code  IPv6 Address


 MAC Address  HTML Colour Codes

Error Code
Error Codes are often shown as Hexadecimal
Values. These numbers refer to the memory
location of the error and are usually automatically
generated by the computer. The programmer needs
to know how to interpret the hexadecimal error
codes. Examples of error codes from a Windows
system are shown below:

MAC Address Code

Media Access Control (MAC) Address refers to a number that uniquely identifies a device on a network. It
refers to the Network Interface Card (NIC) which is part of the device and is rarely changed so that a particular
device can always be identified no matter where it is.

A MAC Address is made up of 48 (or 64) Bits which are shown as 6 groups of 2 Hexadecimal digits:

NN:NN:NN:DD:DD:DD Or NN – NN – NN – DD – DD – DD

 NN:NN:NN is the Device’s Manufacturer’s Number


 DD:DD:DD is the Serial Number of the device
o Serial Number is based on:
 The Region of Manufacturing (Each Region has an Assigned Number)
 The Batch (Each Batch has an Assigned Number)
 The Sequence (The First Device has the Lowest Number)

Example:
In 24:1B:7A:77:A2:FD:

 24:1B:7A, for example, shows that the device was produced by the Apple Corporation
 77:A2:FD, for example, shows that the device was made in China, was a part of Batch 162 and was the
253rd Device to be Manufactured

IP Address

IP (Internet Protocol) Address is an address assigned to every device in the network. An IPv4 Address is
written as a 32-bit Hexadecimal or Decimal Number. Whereas, an IPv6 Address is written as a 128-bit Hexadecimal
or Denary Number. Note that the BitsIP Address = 2Number after v + 1. For Hexadecimal (:) is used and for Decimal (.) is used
HyperText Mark-Up Language (HTML) Colour Codes

HyperText Mark-up Language (HTML) is used when Writing and Developing Web Pages. HTML isn’t a
Programming Language but is simply a Markup Language. A Mark-Up Language is used in the Processing,
Definition and Presentation of Text.

A Hexadecimal Colour is represented by 6 bits: The first 2 bits for Red, the middle 2 bits for Green and the
last 2 bits for Blue.

#000000 = Black
#FF0000 = Red
#00FF00 = Green
#0000FF = Blue
#FFFF00 = Yellow
#FF00FF = Margenta
#00FFFF = Cyan
#FFFFFF = White

Switch to Light Mode to See the Actual Colour except White (#FFFFFF)

-----------------------------------------------------------------------------------------------------------------------------------------------------------

5. Addition of Binary Number

Example: 00100111 + 01001010


Binary Addition usually takes place with Two 8-bit
Binary Numbers with a Maximum Value of 255.
00100111
+ 01001010 Overflow Error occurs when the Binary Addition adds
---------------- up to give a value higher than the Maximum Value.
00011100
----------------
01110001
----------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------

6. Logical Binary Shift

Logical Shift showcases the Multiplication and Division of Binary Numbers by a Power of 2.

If a Left Logical Shift occurs by ‘n’ number of digits, the Binary Number is Multiplied by 2n.

Example: If 000101012 (2110) is Multiplied by 24 (16), it will become 01010000. Note that a ‘1’ is removed due to an
Overflow Error as it would be a 9-digit Binary Number.

If a Right Logical Shift occurs by ‘n’ number of digits, the Binary Number is Divided by 2n.

Example: If 000101012 (2110) is Divided by 24 (16), it will become 00001010. Note that a ‘1’ is removed due to an
Overflow Error as it would be a 9-digit Binary Number.
7. 2’s Complement

To showcase Negative Numbers, we use 2’s Complement where the Place Value of the first digit from the
Left is its Orginal Place Value × -1.

The Maximum and Minimum Values that can be represented in 2’s Complement becomes 2n – 1 and -2n.

As a Number is Represented by an 8-bit Binary Number, the Place Value of the First Digit (from the Left) in a 2’s
Complement is equal to -128; and the Maximum and Minimum Values that can be represented are 127 and -128.

You might also like