Professional Documents
Culture Documents
NUMBERING SYSTEMS
1.0
INTRODUCTION
Many number systems are in use in digital/analogue technology. The most common are:
Decimal
Binary
Hexadecimal
Understanding these numbering systems is important because their use simplifies other
complex topics including boolean algebra and logic design, signed numeric representation,
character codes, and packed data.
1.1
The Decimal Number System uses base 10. It includes the digits from 0 through 9. The
Decimal Number System has a position value characteristic. The weighted values for each
position is as follows:
10^4
10000 1000
100
10
.1
.01
.001
______________________________________________________________________
Digital Electronics - BED12103
UniKL BMI
right of the decimal point represent a value between zero and nine times an increasing
negative power of ten.
The binary number system works like the decimal number system except the Binary
Number System:
uses base 2
includes only the digits 0 and 1 (any other digit would make the number an
invalid binary number)
64
32
16
To make binary numbers more readable, a space is added every four digits starting from the
least significant digit on the left of the decimal point. For example, the binary value
1010111110110010 will be written 1010 1111 1011 0010.
1.2.1
1.2.1.1
To convert from a binary number to a decimal number, we multiply each digit by its
weighted position, and add each of the weighted values together.
For example, the binary value 1100 1010 represents:
1*2^7 + 1*2^6 + 0*2^5 + 0*2^4 + 1*2^3 + 0*2^2 + 1*2^1 + 0*2^0 =
1 * 128 + 1 * 64 + 0 * 32 + 0 * 16 + 1 * 8 + 0 * 4 + 1 * 2 + 0 * 1 =
______________________________________________________________________
Digital Electronics - BED12103
UniKL BMI
128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 =
202
1.2.1.2
Decimal to Binary
To convert from decimal to binary; we divide the decimal number by 2, if the remainder is
0, on the side write down a 0. If the remainder is 1, write down a 1. This process is
continued by dividing the quotient by 2 and dropping the previous remainder until the
quotient is 0. When performing the division, the remainders which will represent the binary
equivalent of the decimal number are written beginning at the least significant digit (right)
and each new digit is written to more significant digit (the left) of the previous digit.
Consider the number 83.
Binary Number
83 / 2
41
41 / 2
20
11
20 / 2
10
011
10 / 2
0 011
5/2
10 011
2/2
010 011
1/2
1010 011
______________________________________________________________________
Digital Electronics - BED12103
UniKL BMI
1.2.2
We typically write binary numbers as a sequence of bits (bits is short for binary digits). We
have defined boundaries for these bits. These boundaries are:
Name
Size (bits)
Example
Bit
Nibble
0101
Byte
0000 0101
Word
16
Double Word
32
In any number base, we may add as many leading zeroes as we wish without changing its
value. However, we normally add leading zeroes to adjust the binary number to a desired
size boundary.
For example, we can represent the number five as:
Bit
101
Nibble
0101
Byte
0000 0101
Word
Exercises:
1. Convert the following binary numbers to their decimal equivalents:
(a) 0001
(b) 0101
______________________________________________________________________
Digital Electronics - BED12103
UniKL BMI
(b) 1000
(d) 1011
(e) 1111
(f) 0111
(b) 00010000
(b) 00110011
(d) 01100100
(e) 00011111
(f) 11111111
2.0
(a) 7
(b) 48
(c) 254
(d) 1793
BINARY ARITHMETIC
To explore the basic principles that are needed to understand how digital systems perform
the basic arithmetic operation such as addition, subtraction, multiplication and division.
2.1
BINARY ADDITION
______________________________________________________________________
Digital Electronics - BED12103
UniKL BMI
General Principles:
0+0=0
1+0=1
1 + 1 = 10 = 0 + carry of 1 into next position
1 + 1 + 1 = 11 = 1 + carry of 1 into next position
Carry in from
next less
significanct
place
Augend
Addend
Sum
0
+
0
1
1
Augend
111 1
00 1 1 10 1
59
+1
+1
+1
Addend
1
+ 00 1 0 10 1
+42
10
11
Sum
01 1 0 01 0
10110
12
(a) Rules for binary addition
CarryCarry
out to
next more
out
significant
place
Figure: 1
1 10
______________________________________________________________________
Digital Electronics - BED12103
UniKL BMI
0
10
Minuend
0
1
1
0
Subtrahend - 0 - 1 - 0
-1
Difference
0
0
1
1
(a) Rules for binary subtraction
10 0 10
71
0 1 0 1 0 1 0 1
85
- 0 0 1 1 1 0 1 1
- 57
0 0 0 1 1 1 0 0 2 2810
(b) Binary subtraction problem
Figure: 2
Multiplicand
Multiplier
Difference
0
x0
0
1
x0
0
0
x1
0
1
x1
1
Multiplicand
Multiplier
First partial product
Second partial product
Third partial product
Final product
1101
X 101
1101
0000
1101
10000012
13
X5
6510
0011
11 1001
011
0011
0011
0000
quotient
dividend
remainder
______________________________________________________________________
Digital Electronics - BED12103
UniKL BMI
Exercises:
a). Solve the following binary addition problems:
i. 1010 + 0101
ii. 01011011 + 00001111
b). Solve the following binary subtraction problems:
i. 1110 1000
ii. 01100110 00011010
c). Solve the following binary multiplication problems:
i. 1001 x 11
ii. 1111 x 101
d). Solve the following binary division problems:
i. 1001 11
______________________________________________________________________
Digital Electronics - BED12103