DLD Week 1 - Intro To Number Systems and BCD
DLD Week 1 - Intro To Number Systems and BCD
Profile: https://cse.uiu.ac.bd/profiles/rahman-raiyan/
7/26/2023 14
CSE 1125 : Digital Logic Design
Introduction
Week 1 Class 1
Numbers!
21
Lecture Outline
A Brief History of Numbers and Civilizations Binary Codes
How can we understand the numbers of other Binary Coded Decimal (BCD)
civilizations ?
Binary arithmetic
• Binary to decimal
• Single Bit Addition with Carry
• Octal to decimal
• Multiple Bit Addition
• Hexadecimal to decimal
• BCD Addition
What our numbers can mean to other civilizations
• Decimal to binary
• Decimal to octal
• Decimal to hexadecimal
Conversion of number systems with 2n digits
• Octal ↔ Binary
• Hexadecimal ↔ Binary
• Octal ↔ Hexadecimal
1/27/2023 Lec Raiyan Rahman, Dept. of CSE, UIU 22
Lecture Outline
A Brief History of Numbers and Civilizations Binary Codes
How can we understand the numbers of other Binary Coded Decimal (BCD)
civilizations ?
Binary arithmetic
• Binary to decimal
• Single Bit Addition with Carry
• Octal to decimal
• Multiple Bit Addition
• Hexadecimal to decimal
• BCD Addition
What our numbers can mean to other civilizations
• Decimal to binary
• Decimal to octal
• Decimal to hexadecimal
Conversion of number systems with 2n digits
• Octal ↔ Binary
• Hexadecimal ↔ Binary
• Octal ↔ Hexadecimal
1/27/2023 Lec Raiyan Rahman, Dept. of CSE, UIU 23
A Brief History of Numbers and Civilizations
The origin of our number system
• Why do you think our natural number system contains only 10 digits?
• 0 123456789
• It is related to our anatomy!
26
1/27/2023 Lec Raiyan Rahman, Dept. of CSE, UIU
A Brief History of Numbers and Civilizations
(Cont.)
• But this is a tedious and limited approach!
• Hence, different civilizations began to develop different number
systems.
14
1/27/2023 Lec Raiyan Rahman, Dept. of CSE, UIU 28
A Brief History of Numbers and Civilizations
(Cont.)
Different Civilizations Different Number Systems
• Arabs
• 10 digits – base 10 number system
• We just saw
• Mayans
• 20 digits – base 20 number system
• They did not wear sandals as they lived in a hot climate
• Babylonians
• 60 digits – base 60 number system
• The number 60 was important to them because they were engaged deeply in astronomical studies, also
because we have 12 joint in our 4 fingers (excluding the thumb) and 60 is a multiple of 12. More.
• The Babylonians also came up with the concept of
• a degree being divided into 60 minutes
• with each minute being divided into 60 seconds.
•1234 = 1X103+2X102+3X101+4X100
•231.45 = ?
Note:
• A total of 10 digits are available in our system (0,1,2,3,4,5,6,7,8,9)
• For our number system 10 is called the base or the radix
• We can also write the above two numbers like this :
• (1234) 10
• (231.45)10
Binary Octal
Decimal
Hexa N-base
Decimal number
system
• Numeric
• Must represent range of data needed
• Very desirable to represent data such that simple, straightforward computation for
common arithmetic operations permitted
• Tight relation to binary numbers
n = log2 M
Here M= 7
n = log2 M = log2 7 = 2.80
• -6 = No representation
Range: 0 to 2n
Signed representation
• +6=0 110
• -6= 1 110
• Numeric
• Must represent range of data needed
• Very desirable to represent data such that simple, straightforward
computation for common arithmetic operations permitted
• Tight relation to binary numbers
• You want to represent all the countries in the world, using binary
numbers. How many bits are required to do so?
• Ans : 2n