1.number Systems Ver1
1.number Systems Ver1
• Decimal 0-9=10=Base 10
• Binary= 1,0=2= Base 2
• Hexadecimal=0-9, A-F= Base 16
• BD
• DB
• HD
• DH
• HB
• BH
• Selected areas covered in this chapter:
– Understanding and Converting between
number systems.
• Decimal, binary, hexadecimal.
– Advantages of the hexadecimal number
system.
Objectives
• Counting in hexadecimal.
– Representing decimal numbers using
the BCD code.
• Pros and cons of using BCD.
• Differences between BCD and
straight binary.
– Purpose of alphanumeric codes such as
ASCII code.
– Parity method for error detection.
• Determine the parity bit to be
attached to a digital data string.
Binary is a language written with a
combination of ones (1) and zeros (0) that
computers use to carry out commands, inputs,
or functions.
Whatever you write onto a computer, a
machine inside processes the input and
converts it into binary. It's like using a
translator!
2-1 Binary to Decimal Conversion
• Convert binary to decimal by summing the positions that contain a 1:
• 100110 =(2^5)+ (2^2)+ (2^1)= 32+4+2=38
Example 2^7 2^6 2^5 2^4 2^3 2^2 2^1 Answer
2^0
128 64 32 16 8 4 2 1
B D
100110 1 0 0 1 1 0
32 4 2 38
10110101 1 0 1 1 0 1 0 1
• An example with a greater number of bits:
128 32 16 4 1 181
D B
45 0 0 1 0 1 1 0 1 101101
76 1 0 0 1 1 0 0 1001100
150 1 0 0 1 0 1 1 0 10010110
• Another example:
Repeated
Division
Divide the decimal
number by 2.
Write the remainder
after each division
until a quotient of
zero is obtained.
The first remainder
is the LSB.
The last is the MSB.
Exercise
Convert the following binary numbers to decimal
111
1001
11001
10001
11000
Exercise
Convert the following decimal to binary
32
50
80
125
300
To perform conversions
between hex & binary, it
is necessary to know the
four-bit binary numbers
(0000 - 1111), and their
equivalent hex digits.
Relationships between
hexadecimal, decimal,
and binary numbers.
Method II:
Use repeated division by radix.
16 | 1564
97
16|_____ R = 12 = C
6
16|_____ R=1
0 R=6
N = 61C 16
2-3 Hexadecimal Number System – Decimal to Hex to Binary
Exercise
Convert the following decimals to hex
100
180
250
320
550
1600
Exercise
Convert the following Hexadecimals to Decimals
111
A12
AD5
5F5A
9E7C
01 1 0 0 0 0 1 1 1 0 0
Pad with 0’s
If unsigned number
(1 E 9 C)16
Example:
38,39,3A,3B,3C,3D,3E,3F,40,41,42
When there is a 9 in a digit position, it
becomes an A when it is incremented.
Exercise
Convert the following Hex to Binary
987
B125
A6F8
12CD4
FF7D3