Chapter 2 - Number & Codes
Chapter 2 - Number & Codes
Chapter 2 - Number & Codes
Digital Codes
Decimal, Binary, Hexadecimal & Octal Numbers
Number Conversions
Binary Arithmetic
Binary Codes
Number Systems
• The value of decimal number is a sum of the digits after each digits
multiplied by its weight.
• Solution:
2745.214 = (2 x 103) + (7 x 102) + (4 x 101) + (5 x 100) + (2 x 10-1) +
(1 x 10-2) + (4 x 10-3)
= (2 x 1000) + (7 x 100) + (4 x 10) + 5 + (2 x 0.1) +
(1 x 0.01) + (4 x 0.001)
= 2000 + 700 + 40 + 5 + 0.2 + 0.01 + 0.004
Mohd Afzan Othman
Binary Numbers
• Use Base-2 system.
• 2 binary digits (bits)/symbols: 0 and 1.
• Example: 00, 01, 10, 11, 100, 101, 110, 111, …
• The value of a bit is determined by its position in the number.
• The position of 0 and 1 indicates its weight, or value within
number.
• The right-most bit is the LSB (least significant bit), in binary whole
number it has weight 20 = 1. The weight increase from right to left
by power of two.
Mohd Afzan Othman
Binary Numbers
• The left-most bit is the MSB (most significant bit).
• Answer: 5478
• Answer: 0.248
• Answer: 28A16
• Answer: 0.516
1101.0112
10101.112
245.62510
70310
A8516
• Also known as BCD 8421 code because the numbers indicate as the weight
of each bits.