4. Digital Electronics 4
Number Systems
R is the radix or base of the number system
− Must be a positive number
− R digits in the number system: [0 .. R-1]
Important number systems for digital systems:
− Base 2 (binary): [0, 1]
− Base 8 (octal): [0 .. 7]
− Base 16 (hexadecimal): [0 .. 9, A, B, C, D, E, F]
5. ECE 301 - Digital Electronics 5
Number Systems
Positional Notation
D = [a4
a3
a2
a1
a0
.a-1
a-2
a-3
]R
D = decimal value
ai
= ith
position in the number
R = radix or base of the number
6. Digital Electronics 6
Number Systems
Power Series Expansion
D = an
x R4
+ an-1
x R3
+ … + a0
x R0
+ a-1
x R-1
+ a-2
x R-2
+ … a-m
x R-m
D = decimal value
ai
= ith
position in the number
R = radix or base of the number
12. Digital Electronics 12
Number System Conversion
Conversion of a mixed decimal number is
implemented as follows:
− Convert the integer part of the number using
repeated division.
− Convert the fractional part of the decimal
number using repeated multiplication.
− Combine the integer and fractional
components in the new base.
14. Digital Electronics 14
Number System Conversion
Conversion between any two bases, A and B,
can be carried out directly using repeated
division and repeated multiplication.
− Base A → Base B
However, it is generally easier to convert base
A to its decimal equivalent and then convert the
decimal value to base B.
− Base A → Decimal → Base B
Power Series Expansion Repeated Division, Repeated Multiplication
15. Digital Electronics 15
Number System Conversion
Conversion between binary and octal can be
carried out by inspection.
− Each octal digit corresponds to 3 bits
101 110 010 . 011 0012
= 5 6 2 . 3 18
010 011 100 . 101 0012
= 2 3 4 . 5 18
7 4 5 . 3 28
= 111 100 101 . 011 0102
3 0 6 . 0 58
= 011 000 110 . 000 1012
− Is the number 392.248
a valid octal number?
16. Digital Electronics 16
Number System Conversion
Conversion between binary and hexadecimal
can be carried out by inspection.
− Each hexadecimal digit corresponds to 4 bits
1001 1010 0110 . 1011 01012
= 9 A 6 . B 516
1100 1011 1000 . 1110 01112
= C B 8 . E 716
E 9 4 . D 216
= 1110 1001 0100 . 1101 00102
1 C 7 . 8 F16
= 0001 1100 0111 . 1000 11112
− Note that the hexadecimal number system requires
additional characters to represent its 16 values.
25. ECE 301 - Digital Electronics 25
Basic Binary Arithmetic
Single-bit Addition Single-bit Subtraction
s
0
1
1
0
c
0
0
0
1
x y
0
0
1
1
0
1
0
1
Carry Sum
d
0
1
1
0
x y
0
0
1
1
0
1
0
1
Difference
What logic function is this?
What logic function is this?