0% found this document useful (0 votes)
11 views

4a (Digital System) Number System

Chapter 4 of MEC523 covers the introduction to numbering systems and conversions, focusing on binary, decimal, octal, and hexadecimal systems. It explains the advantages of digital circuits, the process of converting between different number systems, and provides examples for binary-decimal, decimal-binary, binary-octal, and hexadecimal conversions. The chapter also includes exercises for practice and discusses binary addition and subtraction.

Uploaded by

2023471992
Copyright
© © All Rights Reserved
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

4a (Digital System) Number System

Chapter 4 of MEC523 covers the introduction to numbering systems and conversions, focusing on binary, decimal, octal, and hexadecimal systems. It explains the advantages of digital circuits, the process of converting between different number systems, and provides examples for binary-decimal, decimal-binary, binary-octal, and hexadecimal conversions. The chapter also includes exercises for practice and discusses binary addition and subtraction.

Uploaded by

2023471992
Copyright
© © All Rights Reserved
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
You are on page 1/ 54

MEC523CHAPTER 4

DIGITAL SYSTEM
CHAPTER 4A:
INTRODUCTION TO NUMBERING SYSTEM
AND CONVERSION

DR ROSHAKIMAH MOHD ISA


T2-A14-7C
0199503432
Learning Outcome
Able to convert between different
number systems
Able to understand and use logic gates and Boolean
algebra
Able to minimize Boolean functions using KMap
Able to design and construct combinational logic
circuits
Able to use Medium-scale integration (MSI) devices
Able to design and construct sequential logic circuits
Analog Circuits vs Digital Circuits
Analog quantities have Digital quantities have
continuous values discrete sets of values
Advantages of digital circuit

1) signals represented digitally can be


transmitted without degradation due to
noise.
2) Can be used to store large quantity of
data easily.eg: thumb-drive, hard-disk.
3) Are much simpler than analog circuits
in terms of design and operation. Only
process two values- high and low
4) To process digital signals, it is
important to know how numbers and
values are represented in digital circuits.
This covered in chapter ‘Numbering
Conversions’
NUMBERING SYSTEM
Consists of binary number, decimal, octal and
hexadecimal.
For binary number (base 2) it only consist of 1 and 0.
Decimal consist of (base 10) 0-9
Octal (0-7) base 8
Hexadecimal (base 16) consist of number 0-F
Decimal Number
DecimalSystem
number system is a base 10 number system having 10 digits from 0 to 9.
This means that any numerical quantity can be represented using these 10 digits.
Decimal number system is also a positional value system.
This means that the value of digits will depend on its position. Let us take an
example to understand this.
Say we have three numbers = 734, 971 and 207. The value of 7 in all three numbers
is different−
In 734, value of 7 is 7 hundreds or 700 or 7 × 100 or 7 × 10 2
In 971, value of 7 is 7 tens or 70 or 7 × 10 or 7 × 10 1
In 207, value 0f 7 is 7 units or 7 or 7 × 1 or 7 × 10 0
The weightage of each position can be represented as follows −

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.

The decimal equivalent of a binary number equals the sum of all


binary number equal the sum of all binary digits multiplied by
their weights.
EXAMPLE
Using the example, 1011.012, the binary number system has
format …..25 24 23 22 21 20. 2-1 2-2 2-32-4…….
Each digit has weight …. 32, 16, 8, 4, 2, 1 for positive number
and 0.5, 0.25, 0.125, 0.0625,., for decimal fraction number.

1/4

The decimal value of the binary number of 1011.012 is equal to


23x1 +22x0+21x1+20x1+0x2-1+1x2-2
= 8+0+2+1+0x0.5+1x0.25 = 11.2510.
Example 1 (binary – decimal)
Find the decimal equivalent of binary number 11111 2

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

2. 2/2 : Remainder = 0 : Quotient = 1

3. 1/2 : Remainder = 1 : Quotient = 0

So equivalent binary of integral part of decimal is 100.


Step 2: Conversion of .47 to binary
4. 0.47 * 2 = 0.94, Integral part: 0

5. 0.94 * 2 = 1.88, Integral part: 1

6. 0.88 * 2 = 1.76, Integral part: 1

So equivalent binary of fractional part of decimal is .011


Step 3: Combined the result of step 1 and 2.
Final answer can be written as:
100 + .011 = 100.011
Exercise: (decimal – binary)
Express the following decimal numbers in the binary form.
a)25.5 b) 10.625
BINARY TO OCTAL

Binary numbers can be


converted into equivalent octal
numbers by making groups of
three bits starting from LSB and
moving towards MSB for
integer part of the number and
then replacing each group of
three bits by its octal
representation.
For fractional part the
groupings of three bits are
made starting from the binary
point.
Example 1 (binary – octal)
Convert 0011001102 to its octal equivalent.
Example 2 (binary – octal)
OCTAL TO BINARY
Octal numbers can be converted into equivalent
binary numbers by replacing each octal digit by its 3 – bit
binary equivalent.
Example 1 (octal – binary)
Convert 7368 into an equivalent binary number.

Solution:
7 3 6

11 011 110
1

Therefore 7368 = 1110111102


HEXADECIMAL
TO BINARY
Hexadecimal numbers
can be converted into
equivalent binary
numbers by replacing
each hex digit by its
equivalent 4 – bit binary
numbers. (0-F)
Example 1 (hexa – binary)
Convert 2 F 9 A 16 to equivalent binary number.
BINARY TO HEXADECIMAL

Binary numbers can be converted into the equivalent


hexadecimal numbers by making groups of four bits
starting from LSB and moving towards MSB for integers
part and then replacing each group of four bits by its
hexadecimal representation.
For the fractional part, the above procedure is repeated
starting from the bit next to the binary point and
moving towards the right.
Example 1 (binary – hexa)
Convert the following binary numbers to their equivalent
hex numbers.
a) 10100110101111
b) 0.00011110101101
Example 2 (BINARY –DECIMAL- HEXA)
Convert binary number 1101010 into
hexadecimal number.
First convert this into decimal number:
= (1101010)2
= 1x26+1x25+0x24+1x23+0x22+1x21+0x20
= 64+32+0+8+0+2+0
= (106)10
Then, convert it into hexadecimal number
= (106)10
= 106/16 = 6, remainder is 10

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 :

Integer and fractional , set a part by a radix point


(decimal). For example ( 6327. 4051)8 is an octal number
OCTAL TO DECIMAL
Any octal number can be converted into its
equivalent decimal number using the weights
assigned to each bit position. Since only eight
digits are used, the weights are powers of 8. these
weights are 80 (Units), 81 (eight’s), 82 (64), 83 (512)
and 84 (4096). If longer octal number involved, the
weights continue in ascending powers of 8.

The decimal equivalent of a octal number


equals the sum of all octal number equal the
sum of all octal digits multiplied by their
weights.
Example 1 (octal – decimal)

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)

Obtain decimal equivalent of hexadecimal number


3A.2F16 solution.
DECIMAL TO HEXADECIMAL
For conversion from decimal to hexadecimal the
procedure used in binary as well as octal system is
applicable, using 16 as the dividing (for integer part) and
multiplying (for fractional part) factor.
Example 1 (decimal – hexa)
Convert the following decimal number into hexadecimal number.
95 10
Example 2
0.5 10
Adding and Subtracting Binary Numbers
Adding and Subtracting Binary Numbers
Binary addition
There are four basic rules in binary addition.
Binary addition
Example - add 112 to 102.
Binary subtraction
There are four basic rules in binary subtraction.
Binary subtraction
Example - Subtract 1102 from 11112.
Example
https://www.cimt.org.uk/projects/mepres/book9/bk9i1/bk9_1i2.html

You might also like