EEB341.Chapter01 - NumberSystems
EEB341.Chapter01 - NumberSystems
N Ditshego
Lecturer
Department of Electrical Engineering
University of Botswana
EEB 341
DIGITAL ELECTRONICS
CHAPTER 1
Numbering Systems, Inter-conversions and
Digital Codes
1
Analogue Signals verses Digital Signals
2
3
Number Systems
The two states of a digital signal can be given various names:
• high and low
• True and false
• 1 and 0
The 1 and 0 notation leads naturally to the binary (base 2) number system, in which
any number can be represented using only these two digits.
Two other number systems, octal (base 8) and hexadecimal (base 16), are closely
related to binary and provide a more condensed number notation.
4
An octal or a hexadecimal number is easily converted to its binary
representation by replacing each octal or hexadecimal digit with its
binary equivalent.
1 bit = bit
4 bits = (one hex digit) = nibble
8 bits = byte
16 bits = word
32 bits = long word
5
Base (Radix)- In the number system the base or radix tells the number of symbols
used in the system.
The base of a number system is indicated by a subscript (decimal number) and this
will be followed by the value of the number. For example (952)10, (456)8, (314)16
6
7
Decimal System
The decimal system is the system which we use in everyday counting. The number system
includes the ten digits from 0 through 9. These digits are recognized as the symbols of the
decimal system. Each digit in a base ten number represents units ten times the units of the
digit to its right.
For example-
9542= 9000 + 500 + 40 +2= (9 × 103) + (5 × 102) + (4 × 10) + (2× 100)
Binary System
Computers do not use the decimal system for counting and arithmetic. Their CPU and
memory are made up of millions of tiny switches that can be either in ON and OFF states. 0
represents OFF and 1 represents ON. In this way we use binary system. Binary system has
two numbers 0 and 1. Binary system has base 2 therefore the weight of nth bit of the number
from Right Hand Side is nth bit × 2n-1.
8
Octal System
The octal system is commonly used with computers. The octal number system
with its 8 digit 0,1,2,3,4,5,6, and 7 has base 8. The octal system uses a power
of 8 to determine the digit of a number’s position.
Hexadecimal System
Hexadecimal is another number system that works exactly like the decimal,
binary and octal number systems, except that the base is 16. Each
hexadecimal represents a power of 16. The system uses 0 to 9 numbers and A
to F characters to represent 10 to 15 respectively.
9
Binary Numbers
10
BINARY ADDITION
0+0=0
0+1=1
1+0=1
1 + 1 = 0 (with a carry of 1)
11
12
13
COMPLEMENTS
14
15
16
BINARY COMPLEMENTS
17
18
19
20
21
2’s Complement
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Conversions of Decimal to Binary- The method that is used for converting of
decimals into binary is known as the remainder method. We use the following
steps in getting the binary number:
(b) Write the remainder (which is either 0 or 1) at the right most position.
(c) Repeat the process of dividing by 2 until the quotient is 0 and keep writing the
remainder after each step of division.
36
37
38
39
40
41
42
43
44
Conversions of Decimal Fractions to Hexadecimal Fractions–
16Here we multiply the fraction by 16 instead of 2 or 8. If the non-
zero integer is in between 10 to , then the number is represented
by A to F respectively.
45
46
Digital Codes
47
Binary Coded Decimal (BCD)
4-bit binary number used to represent each
decimal digit.
49
In BCD, each decimal digit is replaced by its binary
equivalent value.
Example:
50
Gray Code
Sometimes codes can also be constructed using a property called reflected
symmetry. One such code is known as the Gray code. The Gray code is used in
Karnaugh maps for simplifying combinational logic design.
Consider the two bits 0 and 1, and stack these two bits. Assume that there is a
plane mirror in front of this stack and produce the reflected image of the stack as
shown in the following:
51
Appending a zero to all elements of the stack above the plane mirror and
appending a one to all elements of the stack that lies below the mirror
will provide the following result:
52
53
Excess-3 Code
The excess-3 representation of a decimal digit d can be obtained by adding
3 to its value. All decimal digits and their excess-3 representations are
listed in the table.
54
55