Digital Logic & Computer Organization and Architecture
Digital Logic & Computer Organization and Architecture
Weighted Unweighted
Octal Excess-3
MSB LSB
Replace LSB with 0 = 1 0 1 0 0=20
Replace MSB with 0 =0 0 1 0 1=5
Bits
Bit is smallest unit of data
1 Nibble= 4 Bits (Used to represent BCD and
HEX)
1 Byte= 8 bits
1 word=18 bits=2 bytes
1 Double word=32 bits=4 bytes
Number System Conversions
CONVERSION AMONG BASES
• The possibilities:
Decimal-10 Octal-8
Binary-2 Hexadecimal-16
EXAMPLE
Base
BINARY TO DECIMAL
Decimal Octal
Binary Hexadecimal
OTHERS TO DECIMAL
(a3a2a1a0. a-1a-2)r ( )10
(a3* r3+a2* r2 +a1* r1 +a0* r0 . a-1* r-1+a-2* r-2 )=( )10
• Technique
• Multiply each bit by 2n, where n is the “weight” of the bit
• The weight is the position of the bit, starting from 0 on
the right
• Add the results
EXAMPLE
Bit “0”
1010112 => 1 x = 1
20
1 x = 2
0 x 21 = 0
1 x = 8
0 x 22 = 0
1 x 23 = 32
24
4310
25
OCTAL TO DECIMAL
Decimal Octal
Binary Hexadecimal
OCTAL TO DECIMAL
Technique
7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
HEXADECIMAL TO DECIMAL
Decimal Octal
Binary Hexadecimal
HEXADECIMAL TO DECIMAL
• Technique
• Multiply each bit by 16n, where n is the “weight” of the bit
• The weight is the position of the bit, starting from 0 on
the right
• Add the results
EXAMPLE
Decimal Octal
Binary Hexadecimal
HEXADECIMAL TO BINARY
• Technique
• Convert each hexadecimal digit to a 4-bit equivalent
binary representation
EXAMPLE
10AF16 = ?2
Four digit binary number ->8 4 2 1
1 0 A(10) F(15)
10AF16 = 00010000101011112
DECIMAL TO ANY BASE (r)
• Technique
• To convert decimal to any other base r , divide integer
part by r and multiply fractional part by r.
DECIMAL TO BINARY
Decimal Octal
Binary Hexadecimal
DECIMAL TO BINARY
Technique
To convert decimal to binary, divide integer part by 2 and
multiply fractional part by 2.
DECIMAL TO Octal
Technique
To convert decimal to binary, divide integer part by 8 and
multiply fractional part by 8.
DECIMAL TO Hexadecimal
Technique
To convert decimal to binary, divide integer part by 16 and
multiply fractional part by 16.
OCTAL TO BINARY
Decimal Octal
Binary Hexadecimal
OCTAL TO BINARY
• Technique
• Convert each octal digit to a 3-bit equivalent
binary representation
BINARY TO OCTAL
• Technique
• Make group of 3 bits and find the octal number
representation.
HEXADECIMAL TO BINARY
• Technique
• Convert each octal digit to a 4-bit equivalent
binary representation
BINARY TO HEXADECIMAL
• Technique
• Make group of 4 bits and find the HEX number
representation
OCTAL TO HEXADECIMAL
• 132 8 = (?) 16
• Octal ↔ Binary ↔ Hex
0010110102 = 5
A 16
1 3 2 0101 1 01
0