0% found this document useful (0 votes)
23 views68 pages

Chp2 NumberSystems

The document discusses number systems including binary, octal, hexadecimal and decimal. It explains how to convert between these different number systems both for whole numbers and fractional numbers. Examples are provided for converting between the different number systems.

Uploaded by

fluffynoob1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views68 pages

Chp2 NumberSystems

The document discusses number systems including binary, octal, hexadecimal and decimal. It explains how to convert between these different number systems both for whole numbers and fractional numbers. Examples are provided for converting between the different number systems.

Uploaded by

fluffynoob1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

Instructions for using the PowerPoint slides:

To view the animated steps - click anywhere on the slide.

To skip the animated steps to go to previous or next page -


click the arrowheads at the bottom right.

Chp 2 Number Systems 1


Chp 2

1. Introductory Concepts
2. Numbering Systems (conversion)
3. Boolean Algebra
4. Combinational Logic
5. Flip-Flops
6. Arithmetic Circuit
7. Counters & Shift Registers
8. MSI Devices
9. Logic Families

Chp 2 Number Systems 2


2 . Numbering Systems (conversion)

Binary

Decimal Octal

Range Hexadecimal
Calculation
(from chapter 1) BCD

Chp 2 Number Systems 3


Chp 2

Why conversion?
 Need to represent real-world data (temperature,
speed, voltage) in a digital format.

 Conversion provides additional information about


the decimal number (such as how many bits are
required to represent it).

Chp 2 Number Systems 4


2.3

Binary Number System

 Base 2

 2 symbols :

Chp 2 Number Systems 5


2.3

Binary Number System

 Base 2

 2 symbols : 0 1

 e.g. : 1 0 1 1 . 1 12

Chp 2 Number Systems 6


2.3

Counting in Binary

Try counting from 10 to 1000

10 11 100 101 110 111 1000

Chp 2 Number Systems 7


2.4
Why do we need Octal & Hex number systems?

 Computers work in binary and usually have to process


large binary numbers

 It is more convenient to represent large binary numbers


in Hex or Octal

 E.g. Memory addresses are usually expressed in Hex

 Octal and Hex are easily converted to/from Binary

Chp 2 Number Systems 8


2.3

Octal Number System

 Base 8

 8 symbols :

Chp 2 Number Systems 9


2.3

Octal Number System

 Base 8

 8 symbols : 01234567

 e.g. : 1 4 2 3 . 4 18

Chp 2 Number Systems 10


2.3

Counting in Octal

Try counting from 66 to 100

66 67 68 70 71 72 73 74 75 76 77 78 80 100

Chp 2 Number Systems 11


2.3

Hexadecimal Number System

 Base 16

 16 symbols :

Chp 2 Number Systems 12


2.3

Hexadecimal Number System

 Base 16

 16 symbols :
Hexa Decimal

0123456789ABCDEF A 10
B 11
C 12
 e.g. : A B 0 . C116 D 13
E 14
F 15

Chp 2 Number Systems 13


2.4

Counting in Hexadecimal

Try counting from 3816 to 4216

Try counting from 9816 to A116

Chp 2 Number Systems 14


2.4

Counting in Hexadecimal

Try counting from 3816 to 4216


38 39 40 3A 3B 3C 3D 3E 3F 40 41 42

Try counting from 9816 to A116

98 99 100 9A 9B 9C 9D 9E 9F 100 A0 A1

Chp 2 Number Systems 15


2.1
Binary to Decimal

Convert 1 1 0 0. 0 1 2 to decimal.
Binary point
1 1 0 0 . 0 12
= 1x23 + 1x22 + 0x21 + 0x20 + 0x2-1 + 1x2-2
= 8 + 4 + 0 + 0 + 0 + 0.25
= 12.2510

Sum of binary bit times its positional weight

Chp 2 Number Systems 16


2.2

Convert 1011.01 2 into its decimal equivalent?

8+0+2+1+0+0.25=11.25

Chp 2 Number Systems 17


2.2

Convert 10101.01 2 into its decimal equivalent?

16+0+4+0+1+0+.25= 21. 2510

Chp 2 Number Systems 18


2.1
Octal to Decimal

Convert 372. 0 1 8 to decimal.


Octal point
3 7 2 . 0 18
= 3x82 + 7x81 + 2x80 + 0x8-1 + 1x8-2
= 192 + 56 + 2 + 0 + 0. 015625
= 250.01562510

Sum of Octal digit times its positional weight

Chp 2 Number Systems 19


2.3

Find the decimal equivalent of 271.548?

Chp 2 Number Systems 20


2.3

Find the decimal equivalent of 271.548?

Ans: 185.687510

Chp 2 Number Systems 21


2.1
Hexa to Decimal
Convert A2. 0 1 16 to decimal.

Hexadecimal point
A 2 . 0 116
= 10x161 + 2x160 + 0x16-1 + 1x16-2
= 160 + 2 + 0 + 0.00390625
= 162.0039062510

Sum of Hexa digit times its positional weight

Chp 2 Number Systems 22


2.4

Convert the hexadecimal number E5D7.A316 into


its decimal equivalent?

Chp 2 Number Systems 23


2.4

Convert the hexadecimal number E5D7.A316 into


its decimal equivalent?

**PLEASE ADD WHOLE NUMBER AND DECIMAL


NUMBERS SEPARATELY, Or else calculator might
round up decimal to less decimal places

In this case became 58839.63672 which is wrong

Ans: 58839.6367187510

Chp 2 Number Systems 24


2.2
Decimal to Binary
Convert 49.312510 to Binary

Whole Number Part: 2 49 remainder


Successive division by 2 24 1 LSB
desired base
2 12 0
Record remainders
2 6 0
2 3 0
Ans for whole number part: 2 1 1
1 1 0 0 0 12 0 1 MSB

Stop at 0

Chp 2 Number Systems 25


2.2 Decimal to Binary (cont’d)
Convert 49.312510 to Binary
Fraction part:
Multiply fraction successively by desired base
Record integers produced by the multiplication (overflow)
(overflow)
0.3125 x 2 = 0.625 = 0.625 + 0 (MSB)
0.625 x 2 = 1.25 = 0.25 + 1
0.25 x 2 = 0.5 = 0.5 + 0
0.5 x 2 = 1.0 =0 + 1 (LSB)
Stop at 0
Ans for fraction part: 0.312510 = 0.01012
49.312510 = 110001.01012
Chp 2 Number Systems 26
2.2

Convert the decimal number 14.37510 into its binary


equivalent?

Chp 2 Number Systems 27


2.2

Convert the decimal number 14.37510 into its binary


equivalent?

Ans : 1110.0112

Chp 2 Number Systems 28


2.2
Decimal to Octal
Convert 49.312510 to Octal

Whole Number Part: 8 49 remainder


Successive division by 8 6 1 LSB
desired base
0 6 MSB
Record remainders

Stop at 0
Ans for whole number part:
6 18

Chp 2 Number Systems 29


2.2 Decimal to Octal (cont’d)
Convert 49.312510 to Octal
Fraction part:
Multiply fraction successively by desired base
Record integers produced by the multiplication (overflow)
(overflow)
0.3125 x 8 = 2.5 = 0.5 + 2 (MSB)
0.5 x 8 = 4.0 =0 + 4 (LSB)
Stop at 0
Ans for fraction part: 0.312510 = 0.248

49.312510 = 61.248

Chp 2 Number Systems 30


2.3

Convert the decimal number 124.7812510 into its octal


equivalent?

Chp 2 Number Systems 31


2.3

Convert the decimal number 124.7812510 into its octal


equivalent?

Ans : 174.628
Chp 2 Number Systems 32
2.2
Decimal to Hexadecimal
Convert 59. 351562510 to Hexa

Whole Number Part: 16 59 remainder


Successive division by 16 3 11 LSB
desired base
0 3 MSB
Record remainders

Stop at 0
Ans for whole number part:
3 B16

Chp 2 Number Systems 33


2.2 Decimal to Hexadecimal (cont’d)
Convert 59.351562510 to Hexa
Fraction part:
Multiply fraction successively by desired base
Record integers produced by the multiplication (overflow)
(overflow)
0.3515625 x 16 = 5.625 = 0.625 + 5 (MSB)
0.625 x 16 = 10.0 = 0 + 10 (LSB)
Stop at 0
Ans for fraction part: 0.351562510 = 0.5A16

59.351562510 = 3B.5A16

Chp 2 Number Systems 34


2.4

Convert the decimal number 124.7812510 into its


hexadecimal equivalent.

Chp 2 Number Systems 35


2.4

Convert the decimal number 124.7812510 into its


hexadecimal equivalent.

Ans: 7C.C816

Chp 2 Number Systems 36


2.3

Octal and Binary Relationship


Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
Chp 2 Number Systems 37
2.3

Octal to binary
Convert 375.48 into its binary equivalent.

Can omit 3 7 5.48 Can omit


leading 0 trailing 0
in whole in
number
part
011 111 101 . 1002 fractional
part
i.e 11 111 101 . 1 2
Expand every Octal digit into 3-bit Binary

Chp 2 Number Systems 38


2.3

Convert the following octal number into its binary equivalent?

1752.7148

Chp 2 Number Systems 39


2.3

Convert the following octal number into its binary equivalent?

1752.7148

1 111 101 010 . 111 001 12

Chp 2 Number Systems 40


2.3
Binary to Octal
Convert the 11010.12 into its octal equivalent?

11010.12
Can add
leading 0
011 010 . 1002 Can add
trailing 0
in whole in
number
part
3 2 . 4 fractional
8 part

Group every 3 bits (from the binary point) and


write the octal equivalent for each 3-bit code.

Chp 2 Number Systems 41


2.3

Convert 10010101.10112 into its octal equivalent?

Chp 2 Number Systems 42


2.3

Convert 10010101.10112 into its octal equivalent?

225.548

Chp 2 Number Systems 43


2.3

Convert 17710 to binary


(a) directly
(b) to octal then to binary

Chp 2 Number Systems 44


2.3

Convert 17710 to binary


(a) directly
(b) to octal then to binary

10 110 001 2

Chp 2 Number Systems 45


2.3

Convert 10101110112 to Decimal


Try (a) direct conversion
(b) convert to Octal then to Decimal

Chp 2 Number Systems 46


2.3

Convert 10101110112 to Decimal


Try (a) direct conversion
(b) convert to Octal then to Decimal

Ans : 69910

Chp 2 Number Systems 47


2.3

Tips

• Quicker to convert from


Decimal  Octal  Binary

• Quicker to convert from


Binary  Octal  Decimal

Chp 2 Number Systems 48


2.4
Hexadecimal and Binary Relationship
Hexa Binary Hexa Binary
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111

Chp 2 Number Systems 49


2.4
Hexadecimal to binary
Convert 31. A16 to Binary.
Can omit 3 1 . A 16 Can omit
leading 0 trailing 0
in whole in
number factional
part
0011 0001 . 1010 2
part
i.e 11 0001 . 101 2

Expand every Hexa digit into 4-bit Binary

Chp 2 Number Systems 50


2.4

Convert 175.4E16 into its binary equivalent.

Chp 2 Number Systems 51


2.4

Convert 175.4E16 into its binary equivalent.

1 0111 0101 . 0100 111 2

Chp 2 Number Systems 52


2.4
Binary to Hexadecimal
Convert 101111011.012 to Hexadecimal.

Can add
leading 0 101111011.012
Can add
in whole trailing 0
number 0001 0111 1011 .0100 2
in
part fractional
part
1 7 B . 4 16
Group every 4 bits (from the binary point) and
write the Hexa equivalent for each 4-bit code.

Chp 2 Number Systems 53


2.4

Convert the binary number 110110101.01110112 into


its hexadecimal equivalent?

Chp 2 Number Systems 54


2.4

Convert the binary number 110110101.01110112 into


its hexadecimal equivalent?

Ans: 1B5.7616

Chp 2 Number Systems 55


2.4
**Can also convert into Hexadecimal instead of octal first

(a) Convert 37810 to a 16 bits binary number.


(b) Convert 49FD16 to octal

Chp 2 Number Systems 56


2.4

(a) Convert 37810 to a 16 bits binary number.


(b) Convert 49FD16 to octal

(a) 17A 16 = 1 0111 1010 2


(b) 0100 1001 1111 1101 2 = 44775 8

Chp 2 Number Systems 57


2.5
Don’t confuse with binary numbers

Binary Coded Decimal (BCD)


BCD represents every Decimal Digit as a 4-bit binary :
Decimal BCD
0 0000 1010
1 0001 1011
2 0010 1100
1101 Invalid BCD
3 0011
4 0100 1110
5 0101 1111
6 0110
7 0111
8 1000
9 1001

Chp 2 Number Systems 58


2.3

Counting in BCD
Try counting from 1000BCD to 0001 0011BCD

1000
1001
0001 0000 Must always be in
groups of 4 !!!
0001 0001
0001 0010
0001 0011

Chp 2 Number Systems 59


2.5

Decimal to BCD
Convert 61.810 into BCD
Cannot omit Cannot omit
leading 0 6 1 . 8 10 trailing 0

0110 0001 . 1000 BCD

Expand every Decimal digit into 4-bit BCD

Chp 2 Number Systems 60


2.5

Convert 2 9 4 . 6 10 to equivalent BCD.

Chp 2 Number Systems 61


2.5

Convert 2 9 4 . 6 10 to equivalent BCD.

0010 1001 0100 . 0110 BCD

Chp 2 Number Systems 62


2.5

BCD to Decimal
Convert 1001 0111 0001 BCD to Decimal

1001 0111 . 0001 BCD

9 7 . 1 10

Group every 4-bit BCD (from decimal point) and


write the Decimal equivalent for each 4-bit BCD.

Chp 2 Number Systems 63


2.5

Convert the following BCD number into its


decimal equivalent:

0110 0010 1000 . 1001 0101 0100 BCD

Chp 2 Number Systems 64


2.5

Convert the following BCD number into its


decimal equivalent:

0110 0010 1000 . 1001 0101 0100 BCD


6 2 8 . 9 5 4 10

Chp 2 Number Systems 65


2.6

How many bits are required to represent the decimal numbers


in the range from 0 to 999 using
(a) Binary
(b) BCD code

Chp 2 Number Systems 66


2.6

How many bits are required to represent the decimal numbers


in the range from 0 to 999 using
(a) Binary
(b) BCD code

(a) 2N-1 = 999


2N = 1000
N = 9.97
10 bits are needed for straight binary representation

(b) 4 bits are needed for each decimal digit,


therefore 12 bits are needed for BCD representation

Chp 2 Number Systems 67


The End

Chp 2 Number Systems 68

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy