4a (Digital System) Number System
4a (Digital System) Number System
DIGITAL SYSTEM
CHAPTER 4A:
INTRODUCTION TO NUMBERING SYSTEM
AND CONVERSION
In digital systems, instructions are given through electric signals; variation is done by
varying the voltage of the signal.
Having 10 different voltages to implement decimal number system in digital
equipment is difficult.
So, many number systems that are easier to implement digitally have been
developed.
27FA16
BINARY CONVERSION
BINARY-DECIMAL
Computer is made of millions of miniature transistors that can be turned off or
on like switches. These switches only have two states - ON or OFF, which are
associated with digits 1 and 0 respectively. This fits naturally into a two number
system called the binary number system.
Any binary number can be converted into its equivalent decimal number using
the weights assigned to each bit position. Since only two digits are used, the
weights are powers of 2. these weights are20 (Units), 21 (two’s), 22 (fours), 23
(eights) and 24 (sixteen). If longer binary number involved, the weights continue in
ascending powers of 2.
1/4
Solution:
The equivalent decimal number is,
= 1 x 24 + 1 x 23 + 1 x 22 + 1 x 21 + 1 x 20
= 16 + 8 + 4 + 2 + 1
= ( 31 )10
Example 2 (binary – decimal)
Determine the decimal numbers represented by the
following binary numbers.
a) 101101. 10101
b) 1001 .
0101
DECIMAL-BINARY
Any decimal number can be converted into its equivalent
binary number. For integers, the conversion is
obtained by continuous division by 2 and keeping
track of the remainders, while for fractional parts,
the conversion is effected by continuous
multiplications by 2 and keeping track of the
integers generated.
Example 1 (decimal – binary)
How to convert decimal 13 to its binary equivalent.
Solution:
Example 2 (decimal – binary)
Convert decimal 23 to binary.
Solution:
Example 3 (decimal – binary)
Convert ( 0.65625)10 to an equivalent base –2 number.
Solution:
1.0000
0.65625
Example 4 (decimal – binary)
Given an fraction decimal number n and integer k,
convert decimal number n into equivalent binary number
up-to k precision after decimal point.
Examples:
Input: n = 2.47, k = 5
Output: 10.01111
Input: n = 6.986 k = 8
Output: 110.11111100
Let's take an example for n = 4.47 k = 3
Step 1: Conversion of 4 to binary
1. 4/2 : Remainder = 0 : Quotient = 2
Solution:
7 3 6
11 011 110
1
6/16 = 0, remainder is 6
= (6A)16 which is answer. Other method: if calculate using
calculator (consider the remainder
only)
106 / 16 = 6.625
0.625 x 16 = A
6 / 16 = 0.375
0.375 x 16 = 6
**During exam, you need to show the working
Example 3 (binary – hexa)
Convert binary number 001100101.110111 into hexadecimal
number. Since there is binary point here and fractional part. So,
Therefore, Binary to hexadecimal is,
= (001100101.110111)2
= (0 0110 0101 . 1101 1100)2
= (0110 0101 . 1101 1100)2
= (6 5 . D C)16
= (65.DC)16
OCTAL CONVERSION
The number system with base eight is known as the octal
number system. In this system eight symbols, 0, 1, 2,
3,4,5,6, and 7 are used to represent the number. Similar
to decimal and binary number systems, it is also a
positional system and has, in general, two parts :
7
7
DECIMAL TO OCTAL
For conversion from decimal to octal the procedure
used in binary system is applicable, using 8 as the dividing
(for integer part) and multiplying (for fractional part)
factor.
Exercise (decimal – octal)
247 10 = 367 8
Exercise (decimal – octal)
Exercise (decimal – octal)
63
27
1
HEXADECIMAL CONVERSION
Hexadecimal number system is very popular in computer
uses. The base for hexadecimal number system is 16
which requires 16 distinct symbols to represent the
number.
These are numerals 0 through 9 and alphabets A through
F. This is an alphanumeric number system because its
uses both alphabets and numericals to represent a
hexadecimal number.
HEXADECIMAL TO DECIMAL (hexa – decimal)