SlideShare a Scribd company logo
DEE2034
DIGITAL ELECTRONICS
By: Siti Sabariah Salihin
CHAPTER 1:
NUMBER AND
CODE SYSTEMS
sabariah@psa.edu.my www.baiasalihin.com
Programme Learning Outcomes, PLO
Upon completion of the programme, graduates should be able to:
 PLO 1 : Apply knowledge of mathematics, scince and engineering
fundamentals to well defined electrical and electronic engineering
procedures and practices
Course Learning Outcomes, CLO
 CLO 1 : Illustrate the knowledge of Digital Number Systems, codes and
logic operations correctly.
CHAPTER 1:
NUMBER AND
CODE SYSTEMS
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Upon completion of this Chapter, students should be able to:
 Know the following number system:decimal, binary, octal
and Hexadecimal and convert the numbers from ne system
to another.
 Understand Octal Number System.
 Understande Hexadecimal Number System.
 Understand how binary codes are used in computers
representing decimal digits, alphanumeric characters and
symbols.
CHAPTER 1:
NUMBER AND
CODE SYSTEMS
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1INTRODUCTION
 Many number system are in use in digital
technology. The Most common are the decimal,
binary, octal and hexadecimal system.
 The Binary number system is the most important
one in digital systems.
 The Decimal System is the most familiar because it is
universally used to represent quantities outside a
digital system and it is a tool that we use every day.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 This means that there will be situations where
decimal values have to be converted to binary values
before they are entered into the digital system.
 For example, when you punch a decimal number into
your hand calculator(or computer), the circuitry
inside the device converts the decimal number to a
binary value.
1.1 INTRODUCTION
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Likewise, there will be situations where the binary values
at the outputs of a digital circuit have to be converted to
decimal values for presentation to the outside world.
 For example, your calculator (or computer) uses binary
numbers to calculate answers to a prolem, then converts
the answers to a decimal value before displaying them.
 The octal (base-8) and hexadecimal (based-16) number
systems are both used for the same purpose-to provide
an efficient means for representing large binary
numbers.
1.1 INTRODUCTION
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 An understanding of the system operation requires
the ability to convert from one number system to
another.
 This chapter will show you how to perform these
conversions .
 This chapter will also introduce some of the binary
codes that are used to represent various kinds of
information.
 These binary codes will used 1’s and 0’s .
1.1 INTRODUCTION
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1.1 Decimal Number System
 The Decimal System is composed of 10 numerals or
symbols.
 These 10 symbols are 0,1,2,3,4,5,6,7,8,9 : using these
symbols as digits of a number, we can express any
quantity.
 The decimal system, also called the base-10 system
because it has 10 digits, has evolved naturally as a
result of the fact that man has 10 fingers.
 In fact, the word “digit” is derived from the Latin
word for “Finger”.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 The decimal system is a positional-value system in
which the value of a digit depends on its position.
 For example: consider the decimal number 453.
 Digit 4 actually represents 4 hundreds, the 5
represent 5 tens, and the 3 represent 3 units.
 In essence, the 4 carries the most weight of the three
digits; it is referred to as the most significant digit
(MSD).
 The 3 carries the least weight and is called the least
significant digit (LSD).
1.1.1 Decimal Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Consider another example, 27. 35
 This number is actually equal to 2 tens plus 7 units
plus 3 tenth plus 5 hndredths or 2 x 10 + 7 x 1 + 3 x
0.1 + 5 x 0.01
 The decimal point is used to separate the integer and
fractional parts of the number.
1.1.1 Decimal Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Moreover, the various positions relative to the
decimal point carry weights that can be expressed as
powers of 10.
 Example : 2745.214
10
3
10
2
10
1
10
0
10
-1
10
-2
10
-3
1.1.1 Decimal Number System
2 7 4 5 . 2 1 4
MSD LSDDecimal Point
= (2x 10
3
)+(7x 10
2
)+(4x 10
1
)+(5x 10
0
)+(2x 10
-1
)+(1x 10
-2
)+(4x 10
-3
)
Figure 1 : Decimal position values as power of 10
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 In general any number is simply the sum of products
of each digit value and its positional value.
 Unfortunately, Decimal number system does not
lend itself to convinient implementation in digital
system.
 It is very difficult to design electronics equipment so
that it can work with 10 different voltage levels (0-9).
 For this reason, almost every digital system uses the
binary number system base-2 as the basic number to
design electronics circuits that operate with only two
voltage levels.
1.1.1 Decimal Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 In binary system, there are only two symbols or
possible digit values, 0 and 1.
 Even so, this base-2 system can be used to represent
any quantity that can be represented in decimal or
other number systems.
 All the statements made ealier concering the decimal
system are equally applicable to the binary system.
 The binary system is also a positional-value system,
where in each binary digit has its own value or
weight expressed as a power of 2.
1.1.2 Binary Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Example:
• Here,places to the left of the binary point (counterpart of the
decimal point) are positive power of 2 and places to the right are
negative power of 2.
 Exercise : Find the equivalent in the decimal system for the
number 1011.1012
Answer : 11.62510 (How?)
1.1.2 Binary Number System
1 0 1 1 . 1 0 1
MSB LSB
Binary Point
2
3
2
2
2
1
2
0
2
-1
2
-2
2
-3
Figure 2 : Binary position values as power of 2
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 In the binary system, the term binary digit is often
abbreviated to the term bit, which we will use
henceforth.
1.1.2 Binary Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1.2 Binary Number System
EE202 SEMICONDUCTOR DEVICES
Figure 3 : Binary Counting Sequence
= 8 = 4 = 2 = 1 Decimal
equivalent
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
1
0
1
2
3
0
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
4
5
6
7
1
1
1
1
0
0
0
0
0
0
1
1
0
1
0
1
8
9
10
11
1
1
1
1
1
1
1
1
0
0
1
1
0
1
0
1
12
13
14
15
2
3
2
2
2
1
2
0Weights
LSB
 Example:
What is the largest number that can be represented using
8 bits?
 Solution :
2
N
- 1 = 2
8
-1
= 25510
= 111111112
1.1.2 Binary Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Review Questions:
1. What is the decimal equivalent of 11010112?
2.What is the next binary number following 101112 in
the counting sequence?
3.What is the largest decimal value that can be
represented using 12 bits?
1.1.2 Binary Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 A Binary number can be converted to decimal by
multiplying the weight of each position with the binary digit
and adding together.
 Example :
Convert the Binary number 101102 to its Decimal equivalent.
 Solution:
Binary number 1 0 1 1 02
2
4
+ 2
3
+ 2
2
+ 2
1
+ 2
0
(2
4
x 1)+(2
3
x 0)+(2
2
x 1)+(2
1
x 1)+(2
0
x 0 )
= 16 + 0 + 4 + 2 + 0
= 2210
1.1.3 Binary to Decimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Example :
Convert the Fractional Binary Number 101.102 to its
Decimal equivalent.
 Solution:
Binary Number = 1 0 1 . 1 0
Power of 2 position = 2
2
2
1
2
0
. 2
-1
2
-2
= (2
2
x 1)+(2
1
x 0)+(2
0
x 1) . (2
-1
x 1)+(2
-2
x 0 )
Decimal Value = 4 + 0 + 1 . 0.5 + 0
= 5.5 10
1.1.3 Binary to Decimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1.3 Binary to Decimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1.3 Decimal To Binary conversion
 The most convenient method is called division by 2
method.
 In which first decimal number will be divided by 2.
 The quotient will be dividend for the next step. In each step
the remainder part will be recorded separately.
 The 1st reminder of the 1st division will be the LSB in the
Binary Number.
 The quotient should repeatedly divide by 2 until the
quotient becomes 0.
 The final remainder will be the MSB in Binary number.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Example :
Convert Decimal 2010 to its Binary equivalent.
Solution:
2 20 remainder of 0
2 10 remainder of 0
2 5 remainder of 1
2 2 remainder of 0
2 1 remainder 0f 1
0
1 0 1 0 02
1.1.3 Decimal To Binary conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 When converting a decimal fractional number to its
binary, the decimal fractional part will be multiply by
2 till the fractional part gets 0 or till the number of
decimal places reached.
1.1.3 Decimal To Binary conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Below example show the steps to convert decimal fraction
0.625 to its binary equivalent.
Step 1 : 0.625 will be multiply by 2 ( 0.625 x 2 = 1.25)
Step 2 : The integer part will be the MSB in the binary
result
Step 3 : The fractional part of the earlier result will be
multiply again ( 0.25 x 2 = 0.5 )
Step 4 : Each time after the multiplication the integer part of
the result will be written as the Binary number.
Step 5 : The procedure should continue till the fractional part
gets 0.
1.1.3 Decimal To Binary conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Example :
Convert Decimal 0.62510 to its binary equivalent.
Solution:
0.25 x 2 = 0.50
0. 5 x 2 = 1. 00 LSB
carried MSB 1 0 1
= 0.62510 = . 1012
1.1.3 Decimal To Binary conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Example :
Convert Decimal 3610 to its Binary equivalent.
Solution:
2 36 remainder of 0
2 18 remainder of 0
2 9 remainder of 1
2 4 remainder of 0
2 2 remainder 0f 0
2 1 remainder 0f 1
0
1 0 0 1 0 02
Review Questions:
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1.4 Binary Addition
 Adding of two binary numbers follows same as addition of
two decimal numbers.
 Some times binary addition is very much easier then
Decimal or any other number system addition, because in
binary you deal with only 2 numbers.
 There are mainly 4 rules should be followed in the process
of addition in binary numbers:
sum carryout
Rule 1 : 0 + 0 = 0 0
Rule 2 : 0 + 1 = 1 1
Rule 3 : 1 + 0 = 1 1
Rule 4 : 1 + 1 = 0 1
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Example:
Perform Binary Addition for 1012 + 0102
Solution:
1 0 12
0 1 02 +
1 1 1
Exercise:
Perform Binary Addition for 10112 + 01112
Answer: 10 01 02
1.1.4 Binary Addition
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 When subtracting one binary number A
(subtrahend) from another binary number B
(Minuend) where B > A, the answer is called the
difference.
 There are four basic rules that should be followed in
binary subtracting To perform Rule 2 you have to
borrow 1 from the next left column.
 The weight of the binary you borrow will be 2.
1.1.5 Binary Subtraction
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Minuend (B) Subtrahend (A) Difference Borrow out
 Rule 1 0 - 0 = 0
 Rule 2 0 - 1 = 1 with a borrow of 1
 Rule 3 1 - 0 = 1
 Rule 4 1 - 1 = 0
Example:
Subtract binary 1012 from 1102
0
1 1 0
1 0 1
0 0 1 = 0012
1.1.5 Binary Subtraction
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1.8 Signed Binary Numbers
 A signed number consist both positive and negative
sign with magnitude.
 The additional bit for representing the sign of the
number (+ or -) is known as sign bit.
 in general, 0 in the sign bit represents a positive
number and 1 in the sign bit represents a negative
number.
 The leftmost bit 0 is the sign bit represent +
 The leftmost bit 1 is the sign bit represent -
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Therefore the stored number in register A and B is 13
and -13 respectively in Decimal form.
 The signed bit is used to indicate the positive or
negative nature of the stored binary numbers.
 Here the magnitude bits are the binary equivalent of
the decimal value being represented.
 This is called the sign magnitude system.
1.1.8 Signed Binary Numbers
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.1.8 Signed Binary Numbers
 Sign bit (+) A4 A3 A2 A1 A 0
= +13
B4 B3 B2 B1 B0
= - 13
Representing Signed Number
0 1 1 0 1
1 1 1 0 1
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Example:
 Express the Decimal number -46 in 8 bit Signed
magnitude system
Solution:
True Binary number for +46
= 00101110
Change the sign bit to 1 and remain unchanged
magnitude nits
= 10101110 = -46
1.1.8 Signed Binary Numbers
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.2 Octal Number System
 Octal number has eight possible symbols: 0 , 1 , 2 , 3 ,
4 , 5 , 6 , 7 and used to express binary numbers,
which is called as base of 8 number system or Radix
of 8.
 Figure: illustrated how it decrease with negative
power of 8:
8
5
8
4
8
3
8
2
8
1
8
0
. 8
-1
8
-2
8
-3
8
-4
8
-5
Decrease with negative power of 8
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.2.2 Octal to Binary Conversion
 Any octal number can be represent by 3 bit binary
number, such as 0002 to represent 08 and 111 2 to
represent 78
Example:
Convert 4358 to its Binary equivalent.
Solution:
4 3 58
100 011 101 = 1000111012
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Exercise:
Convert 54.78 to its Binary equivalent.
Solution :
5 4 . 78
101 100 . 111 = 101100.1112
1.2.2 Octal to Binary Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.2.1 Binary to Octal Conversion
 This is the reverse form of the octal to binary conversion.
 First, the Binary number should be divided into group of
three from LSB.
 Then each three-bit binary number is converted to an Octal
form.
Example:
Convert 1001010112 to its equivalent Octal number.
Solution:
100 101 011
4 5 3 = 4 5 38
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Sometimes the Binary numberwill not have even groups of
3 bits.
 For those cases, we can add one or two 0s to the left of the
MSB of the binary number to fill out the last group.
Example:
Convert 110101102 to its equivalent Octal number.
Solution:
011 010 110
3 2 68 =3268
NOTE that a 0 was placed to the left of the MSB to produce even groups of 3 Bits.
1.2.1 Binary to Octal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Octal number can be converted to decimal by multiplying
the weight of each position with the octal number and
adding together.
 Example:
Convert the Octal number 2578 to its decimal equivalent
 Solution:
2578 = (2 x 8
2
)+ (5 x 8
1
)+ (7 x 8
0
)
= (2 x 64) + (5 x 8) + (7 x 1)
= 17510
1.2.2 Octal Number to Decimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Exercise :
Convert the Octal number 17.78 to its Decimal
equivalent
Solution:
17.78 = (1 x 8
1
) + (7 x 80) + (7 x 8
-1
)
= (1 x 8) + (7 x 1) + (7 x .125)
= 15.87510
1.2.2 Octal Number to Decimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Here we can apply the same method done in decimal to
binary conversion. Dividing the decimal number by 8 can
do conversion to octal.
Example :
Convert 9710 to its Octal equivalent.
Solution :
8 97 + remainder of 1
8 12 + remainder of 4
8 1 + remainder of 1
0
1 4 18
1.2.2 Decimal to Octal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Review Question:
1. Convert 6148 to decimal.
2. Convert 14610 to Octal, then from Octal to Binary.
3. Convert 100111012 to Octal.
4. Convert 97510 to Binary by First Coverting to Octal.
5. Convert Binary 10101110112 to Decimal by first converting
to Octal.
Answer:
1. 396 2. 222, 010010010 3. 235
4. 1111001111 5. 699
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.3 Hexadecimal Number System
 Hexadecimal number system is called as base 16
number system.
 It uses 10 decimal numbers and 6 alphabetic
characters to represent all 16 possible symbols.
 Table below, shows Hexadecimal numbers with its
equivalent in decimal and Binary.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Hexadecimal
Number
Binary Number Decimal Nmber
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15
1.3 Hexadecimal Number System
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.3.1 Hexadecimal to Binary Conversion
 Hexadecimal number can be represent in Binary form by
using 4 bits for each hexadecimal number.
016 can be written in binary = 0000
716 in binary can be written = 0111
A16 in binary can be written = 1010
Example:
Convert the Hexadecimal A516 to its Binary equivalent.
Solution : A 516
1010 01012 = 101001012
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Exercise:
Convert the Hexadecimal 9F216 to its Binary
equivalent.
Solution:
9 F 2
1001 1111 0010 = 1001111100102
1.3.1 Hexadecimal to Binary Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 This is the reverse form of the Hexadecimal to Binary
Conversion.
 First the Binary number should be Divided into
group of Four bits from LSB.
 Then each four-bit binary number is converted to a
Hexadecimal form.
1.3.1 Binary to Hexadecimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Example:
Convert the Binary 10110110111110102 to its equivalent
Hexadecimal number.
Solution:
1011 0110 1111 1010
B 6 F A = B6FA16
1.3.1 Binary to Hexadecimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Exercise:
Convert the Binary 11101001102 to its
equivalent Hexadecimal number.
Solution:
0011 1010 01102
3 A 6 = 3A616
1.3.1 Binary to Hexadecimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.3.2 Hexadecimal to Decimal Conversion
 Hexadecimal number can be converted to decimal by
multiplying the weight of each position of the hexadecimal
number (power of 16) and adding togather.
Example:
Convert the Hexadecimal number 32716 to its Decimal
Equivalent.
Solution :
32716 = (3 x 16
2
) + (2 x 16
1
) + (7 x 16
0
)
= ( 3 x 256) + ( 2 x 16 ) + ( 7 x 1 )
= 80710
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Example :
Convert the Hexadecimal number 2AF16 to its
Decimal Equivalent.
Solution:
2AF16 = (2 x 162)+(10 x 161 )+(15 x 160 )
= (512) + (160) + (15)
= 68710
1.3.2 Hexadecimal to Decimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Exercise :
Convert the Hexadecimal number 1BC216 to its
Decimal Equivalent.
Solution:
= (1 x 16
3
)+(11 x 16
2
)+(12 x 16
1
)+(2 x 16
0
)
= 710610
1.3.2 Hexadecimal to Decimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Here we can apply the same method done in Decimal to
Binary conversion.
 Since we need to convert to Hexadecimal, so we have to
divide the Decimal number by 16.
 Example :
Convert the Decimal 38210 to its Hexadecimal
equivalent.
Solution: 16 382 + remainder of 14
16 23 + remainder of 7
0
7 E16
1.3.2 Decimal to Hexadecimal Conversion
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Counting Hexadecimal
 When counting in Hex, each digit position can be
incremented (increased by 1) from 0 to F.
 Once a digit position reaches, the value F, it is
RESET to 0 and the next digit position is
incremented.
 This illustrated in the following Hex counting
sequences.
(a). 38, 39, 3A, 3B, 3C, 3D, 3E, 3F, 40, 41, 42
(b). 6F8, 6F9, 6FA, 6FB, 6FC, 6FD, 6FE, 6FF, 700
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Review Question:
1. Convert 24CE16 to Decimal.
2. Convert 311710 to Hex, then from Hex to Binary.
3. Convert 10010111101101012 to Hex.
4. Write the next four numbers in this Hex counting
sequence. E9A, E9B, E9C, E9D, ___,___,___,___
5. Convert 35278 to Hex.
Answer:
1. 9422 2. C2D ; 110000101101 3. 97B5
4. E9E, E9F, EA0, EA1 5. 757
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.3.3 1's Complement Form
 The 1's complement form of any binary number is
simply obtained by taking the complement form of 0
and 1.
 1 to 0 and 0 to 1
* The range is –(2n-1 – 1) to +(2n-1-1).
Example:
Find the 1's complement 101001
Solution: 1 0 1 0 0 1 Binary Number
0 1 0 1 1 0 1's complement of Binary Number
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 The 2's complement form of binary number is
obtained by taking the complement form of 0, 1 and
adding 1 to LSB.
 The range is –(2n-1) to (2n-1-1).
Example:
Find the 2's complement of 1110010
Solution:
1 1 1 0 0 1 0 Binary Number
0 0 0 1 1 0 1 1's complement
+ 1 Add 1
0 0 0 1 1 1 0 2's complement
1.3.3 2's Complement Form
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.3.3 Signed Number Representing Using
2's Complement
Example:
Express the Decimal number -25 in the 2's complement
system using 8-bits.
Solution:
Represent the +25 in Binary for
0 0 0 1 1 0 0 1
1 1 1 0 0 1 1 0 ( 1's complement)
+1
1 1 1 0 0 1 1 1 ( 2's complement)
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.3.3 2's complement Addition
 The two number in addition are addend and augend which
result in the sum.
 The following five cases can be occur when two binary
numbers are added;
CASE 1: Both number are positive
Straight Foward addition.
Example: +8 and +4 in 5 bits
0 1000 ( + 8, augend)
0 0100 ( + 4, addend)
0 1 1 0 0 ( sum = + 12)
signed bit
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 CASE 2: Positive number larger than negative
number
Example:
Add two numbers +17 and -6 in six bits
Solution:
0 1 0 0 0 1 (+17)
1 1 1 0 1 0 (-6)
1 0 0 1 0 1 1 (+11)
The Final carry bit is disregarded
1.3.3 2's complement Addition
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 CASE 3: Positive number smaller than negative
number
 Example:
 Add two numbers -8 and +4
Solution:
1 1 0 0 0 ( -8, augend)
0 0 1 0 0 ( +4, addend)
1 1 1 0 0 ( sum = -4)
sign bit
1.3.3 2's complement Addition
Since the SUM is negative,
it is in 2's complement form.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Case 4: Both numbers are negative
Example:
Add two numbers -5 and -9 in 8 bits.
Solution:
1 1 1 1 1 0 1 1 (-5)
+ 1 1 1 1 0 1 1 1 (-9)
1 1 1 1 1 0 0 1 0 (-14)
The final carry bit is disregarded
1.3.3 2's complement Addition
Since the SUM is negative,
it is in 2's complement form.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 when subtracting the binary number ( the subtrahend) from
another binary number ( the minuend) then change the sign
of the subtrahend and adds it to the minuend.
Case 1: Both numbers are positive :
Example:
Subtract +41 from +75 in byte.
Solution: Minuend ( +75) = 01001011
Subtrahend (+41)=00101001
Take the 2's complement form of subtrahend (+41) and add
with miuend.
1.3.3 2's complement Subtraction
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
0 1 0 0 1 0 1 1 (+75)
1 1 0 1 0 1 1 1 (-41)
1 0 0 1 0 0 0 1 0 (+34)
discard
1.3.3 2's complement Subtraction
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 CASE 2: Both numbers are negative
Example:
Subtract -30 from -80 in 8bit.
Solution:
In this case (-80) - (-30) = ( -80) + (30)
1 0 1 1 0 0 0 0 (-80)
- 0 0 0 1 1 1 1 0 (+30)
1 1 0 0 1 1 1 0 (-50)
1.3.3 2's complement Subtraction
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 CASE 3 :
Both numbers are opposite sign
Example:
Subtract -20 from + 24 in byte.
Solution:
In this case (+24) - (-20) = (+24)+(20)
0 0 0 1 1 0 0 0(+24)
0 0 0 1 0 1 0 0 (+20)
0 0 1 0 1 1 0 0 (+44)
1.3.3 2's complement Subtraction
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.4 How Binary CODES are Used in Computers
 Binary codes are used in computers representing
Decimal digits, alphanumeric characters and
symbols.
 When Numbers, letters or words are represented by
a speacial group of symbols, we say that they are
being encoded, and the group of symbols is called a
code.
 When a decimal number is represented by its
equivalent binary number, we call it Straight
Binary Coding.
DEE2034 DIGITAL ELECTRONICS
 BCD- Binary Coded Decimal Code
 If each digit of a decimal number is represented by
its binary equivalent, the result is a code called
Binary Coded Decimal , BCD.
 To illustrate the BCD code, take a Decimal number
such as 874.
 Each digit is changed to its Binary Equivalent as
follows :
8 7 4 (Decimal)
1000 0111 0100 (BCD)
1.4.1 BCD 8421 codes
DEE2034 DIGITAL ELECTRONICS
 As another example, let us change 943 to its BCD-
code representation:
9 4 3 (Decimal)
1001 0100 0011 ( BCD)
 Once again, each decimal digit is changed to its
straight Binary equivalent.
 Note that 4 Bits are always used for each digit.
 The BCD code, then represents each digit of the
decimal number by a 4 Bit binary number.
1.4.1 BCD 8421 codes
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 Clearly only the 4-bit binary numbers from 0000
through 1001 are used.
 The BCD code does not use the numbers 1010,
1011, 1100, 1101, 1110 and 1111.
 In other words, only 10 of the 16 possible 4-bit
binary code groups are used.
 If any of the "forbidden" 4-bit numbers ever occurs
in a machine using the BCD code, it is usually an
indication that an error has occurred.
1.4.1 BCD 8421 codes
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Example:
Convert 0110100000111001 (BCD) to its decimal
equivalent.
Solution:
Divide the BCD number into 4-bit groups and convert
each to decimal.
0110 1000 0011 1001
6 8 3 9
1.4.1 BCD 8421 codes
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
Exercise:
Convert the BCD number 011111000001 to its Decimal
equivalent.
Solution:
0111 1100 0001
7 1
Forbidden code group indicates error in
BCD number
1.4.1 BCD 8421 codes
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
1.4.1 Comparison of BCD and Binary
 It is important to realize that BCD is not another number
system like binary, octal, decimal and Hexadecimal.
 It is also important to understand that a BCD number is not
the same as a straight binary number.
 A straight binary code takes the complete decimal number
and represents it in binary.
 BCD code converts each decimal digit to binary
individually.
 Example:
13710 = 100010012 (binary)
13710 = 0001 0011 0111 (BCD)
DEE2034 DIGITAL ELECTRONICS
1.4.2 Alphanumeric Codes
 A computer should recognize codes that represent
letters of the alphabet, puntuation marks, and
other special characters as well as numbers.
 A complete alphanumeric code would include the
26 lowercase latters, 26 uppercase latter, 10
numeric digits, 7 punctuation marks, and
anywhere from 20 to 40 other characters such as +
/ * # and so on.
 we can say that an alphanumeric code represents
all of the various characters and functions that are
found on a standard typewriter or computer
keyboard.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
 The most widely used alphanumeric code.
 American Standard Code for Information
interchange (ASCII).
 Pronounced "askee"
Refer table next slide to see :
Partial Listing of ASCII code.
1.4.2 Alphanumeric Codes - ASCII Code
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
ASCII Reference Table
DEE2034 DIGITAL ELECTRONICS
Extended ASCII Codes
DEE2034 DIGITAL ELECTRONICS
Example:
The following is a message encoded in ASCII code.
What is the message?
1001000 1000101 1001100 1010000
Solution:
Convert each 7-bit code to its Hexadecimal equivalent.
The results are : 48 45 4C 50
Now, locate these Hexadecimal values in table ASCII and
determine the character represented by each. The results are:
H E L P
1.4.2 Alphanumeric Codes - ASCII Code
sabariah@psa.edu.my www.baiasalihin.com
References
 "Digital Systems Principles And Application"
Sixth Editon, Ronald J. Tocci.
 "Digital Systems Fundamentals"
P.W Chandana Prasad, Lau Siong Hoe,
Dr. Ashutosh Kumar Singh, Muhammad Suryanata.
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
The End Of Chapter 1...
 Do Review Questions
 Quiz 1 for Chapter 1- be prepared!!
DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com

More Related Content

PDF
Chapter 2 ee202 boolean part a
PPSX
Dee2034 chapter 2 boolean algebra part a
PDF
Ee 202 chapter 1 number and code system
PDF
Logic Design
PPTX
Chap iii-Logic Gates
DOCX
Digital Electronics Notes
PPT
Digital Logic Design
PDF
Objective Questions Digital Electronics
Chapter 2 ee202 boolean part a
Dee2034 chapter 2 boolean algebra part a
Ee 202 chapter 1 number and code system
Logic Design
Chap iii-Logic Gates
Digital Electronics Notes
Digital Logic Design
Objective Questions Digital Electronics

What's hot (20)

PPT
Digital 1 8
PPSX
Number system logic gates
PPTX
Chapter 4: Combinational Logic
PPT
Digital logic design part1
PPT
Digital Logic circuit
PPTX
Unit-1 Digital Design and Binary Numbers:
PPTX
Introduction of Combinational logic circuits & half adder
PPTX
Combinational circuits
PPTX
Combinational logic circuits by Tahir Yasin
PPT
Digital Logic & Design
PDF
Digital notes
PDF
Combinational Logic Circuits
PPT
Combinational circuits r011
PDF
FYBSC IT Digital Electronics Unit IV Chapter I Multiplexer, Demultiplexer, AL...
PPTX
DEL-244Chep i
PDF
Lecture 01 dld 2018
PDF
Digital electronics(EC8392) unit- 1-Sesha Vidhya S/ ASP/ECE/RMKCET
PPTX
dld 01-introduction
PDF
Number system
PPTX
Combinational circuit
Digital 1 8
Number system logic gates
Chapter 4: Combinational Logic
Digital logic design part1
Digital Logic circuit
Unit-1 Digital Design and Binary Numbers:
Introduction of Combinational logic circuits & half adder
Combinational circuits
Combinational logic circuits by Tahir Yasin
Digital Logic & Design
Digital notes
Combinational Logic Circuits
Combinational circuits r011
FYBSC IT Digital Electronics Unit IV Chapter I Multiplexer, Demultiplexer, AL...
DEL-244Chep i
Lecture 01 dld 2018
Digital electronics(EC8392) unit- 1-Sesha Vidhya S/ ASP/ECE/RMKCET
dld 01-introduction
Number system
Combinational circuit
Ad

Viewers also liked (20)

PDF
Recruitment leaders program prospectus final
PPTX
Pinteresting
PDF
Accessio market entry 2011 public
DOCX
Comenzar con PhoneGap y subir a Googleplay y AppStore
PPT
Centro De Convergencia De Recursos Educativos
PDF
CV Yavuz Samur_YOK
PPTX
Expo bebe
DOCX
Amekqua Resume
PDF
Innobite´s 2nd Workshop Biocomposites & EcoConstruction
PPTX
Smart technology crm tres estrategias de exito
DOCX
Proyecto de aula modulo1
PDF
Anti phishing web browser
PDF
Koordinierungsstelle Bildung - Das Sachgebiet Bildung im Landkreis Barnim
PDF
About le passage to india
PDF
Bioseguridad
PPT
NOVICEproject: Online Moderation
PPTX
PPTX
T.2.5 – road and logistic planning (by itene)
PDF
Preguntas cinemática
Recruitment leaders program prospectus final
Pinteresting
Accessio market entry 2011 public
Comenzar con PhoneGap y subir a Googleplay y AppStore
Centro De Convergencia De Recursos Educativos
CV Yavuz Samur_YOK
Expo bebe
Amekqua Resume
Innobite´s 2nd Workshop Biocomposites & EcoConstruction
Smart technology crm tres estrategias de exito
Proyecto de aula modulo1
Anti phishing web browser
Koordinierungsstelle Bildung - Das Sachgebiet Bildung im Landkreis Barnim
About le passage to india
Bioseguridad
NOVICEproject: Online Moderation
T.2.5 – road and logistic planning (by itene)
Preguntas cinemática
Ad

Similar to Dee 2034 chapter 1 number and code system (Baia) (20)

PPSX
Chapter 1 number and code system sss
DOCX
Physics investigatory project for class 12 logic gates
PDF
Number system
PDF
chap1.pdf
PDF
chap1.pdf
PDF
chap1.pdf
PPTX
Data repersentation.
PPT
Digital Electronics & Fundamental of Microprocessor-I
PPTX
Data Representation
PDF
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
PDF
Module 1 number systems and code1
PPTX
1. Digital Electronics - Number System PART 1.pptx
PPTX
Computer Oraganizaation.pptx
PDF
Digital Electronics
RTF
DCF QNA edited
PPTX
1.Digital Electronics overview & Number Systems.pptx
PDF
Digital Logic
PDF
Analog and Digital Electronics engin.pdf
PPTX
DLD-Introduction.pptx
Chapter 1 number and code system sss
Physics investigatory project for class 12 logic gates
Number system
chap1.pdf
chap1.pdf
chap1.pdf
Data repersentation.
Digital Electronics & Fundamental of Microprocessor-I
Data Representation
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
Module 1 number systems and code1
1. Digital Electronics - Number System PART 1.pptx
Computer Oraganizaation.pptx
Digital Electronics
DCF QNA edited
1.Digital Electronics overview & Number Systems.pptx
Digital Logic
Analog and Digital Electronics engin.pdf
DLD-Introduction.pptx

Recently uploaded (20)

PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Classroom Observation Tools for Teachers
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
master seminar digital applications in india
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Pre independence Education in Inndia.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
RMMM.pdf make it easy to upload and study
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Lesson notes of climatology university.
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Classroom Observation Tools for Teachers
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPH.pptx obstetrics and gynecology in nursing
Final Presentation General Medicine 03-08-2024.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
GDM (1) (1).pptx small presentation for students
master seminar digital applications in india
human mycosis Human fungal infections are called human mycosis..pptx
Pre independence Education in Inndia.pdf
Computing-Curriculum for Schools in Ghana
Renaissance Architecture: A Journey from Faith to Humanism
VCE English Exam - Section C Student Revision Booklet
Anesthesia in Laparoscopic Surgery in India
RMMM.pdf make it easy to upload and study
Supply Chain Operations Speaking Notes -ICLT Program
Lesson notes of climatology university.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf

Dee 2034 chapter 1 number and code system (Baia)

  • 1. DEE2034 DIGITAL ELECTRONICS By: Siti Sabariah Salihin CHAPTER 1: NUMBER AND CODE SYSTEMS sabariah@psa.edu.my www.baiasalihin.com
  • 2. Programme Learning Outcomes, PLO Upon completion of the programme, graduates should be able to:  PLO 1 : Apply knowledge of mathematics, scince and engineering fundamentals to well defined electrical and electronic engineering procedures and practices Course Learning Outcomes, CLO  CLO 1 : Illustrate the knowledge of Digital Number Systems, codes and logic operations correctly. CHAPTER 1: NUMBER AND CODE SYSTEMS DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 3. Upon completion of this Chapter, students should be able to:  Know the following number system:decimal, binary, octal and Hexadecimal and convert the numbers from ne system to another.  Understand Octal Number System.  Understande Hexadecimal Number System.  Understand how binary codes are used in computers representing decimal digits, alphanumeric characters and symbols. CHAPTER 1: NUMBER AND CODE SYSTEMS DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 4. 1.1INTRODUCTION  Many number system are in use in digital technology. The Most common are the decimal, binary, octal and hexadecimal system.  The Binary number system is the most important one in digital systems.  The Decimal System is the most familiar because it is universally used to represent quantities outside a digital system and it is a tool that we use every day. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 5.  This means that there will be situations where decimal values have to be converted to binary values before they are entered into the digital system.  For example, when you punch a decimal number into your hand calculator(or computer), the circuitry inside the device converts the decimal number to a binary value. 1.1 INTRODUCTION DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 6.  Likewise, there will be situations where the binary values at the outputs of a digital circuit have to be converted to decimal values for presentation to the outside world.  For example, your calculator (or computer) uses binary numbers to calculate answers to a prolem, then converts the answers to a decimal value before displaying them.  The octal (base-8) and hexadecimal (based-16) number systems are both used for the same purpose-to provide an efficient means for representing large binary numbers. 1.1 INTRODUCTION DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 7.  An understanding of the system operation requires the ability to convert from one number system to another.  This chapter will show you how to perform these conversions .  This chapter will also introduce some of the binary codes that are used to represent various kinds of information.  These binary codes will used 1’s and 0’s . 1.1 INTRODUCTION DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 8. 1.1.1 Decimal Number System  The Decimal System is composed of 10 numerals or symbols.  These 10 symbols are 0,1,2,3,4,5,6,7,8,9 : using these symbols as digits of a number, we can express any quantity.  The decimal system, also called the base-10 system because it has 10 digits, has evolved naturally as a result of the fact that man has 10 fingers.  In fact, the word “digit” is derived from the Latin word for “Finger”. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 9.  The decimal system is a positional-value system in which the value of a digit depends on its position.  For example: consider the decimal number 453.  Digit 4 actually represents 4 hundreds, the 5 represent 5 tens, and the 3 represent 3 units.  In essence, the 4 carries the most weight of the three digits; it is referred to as the most significant digit (MSD).  The 3 carries the least weight and is called the least significant digit (LSD). 1.1.1 Decimal Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 10.  Consider another example, 27. 35  This number is actually equal to 2 tens plus 7 units plus 3 tenth plus 5 hndredths or 2 x 10 + 7 x 1 + 3 x 0.1 + 5 x 0.01  The decimal point is used to separate the integer and fractional parts of the number. 1.1.1 Decimal Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 11.  Moreover, the various positions relative to the decimal point carry weights that can be expressed as powers of 10.  Example : 2745.214 10 3 10 2 10 1 10 0 10 -1 10 -2 10 -3 1.1.1 Decimal Number System 2 7 4 5 . 2 1 4 MSD LSDDecimal Point = (2x 10 3 )+(7x 10 2 )+(4x 10 1 )+(5x 10 0 )+(2x 10 -1 )+(1x 10 -2 )+(4x 10 -3 ) Figure 1 : Decimal position values as power of 10 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 12.  In general any number is simply the sum of products of each digit value and its positional value.  Unfortunately, Decimal number system does not lend itself to convinient implementation in digital system.  It is very difficult to design electronics equipment so that it can work with 10 different voltage levels (0-9).  For this reason, almost every digital system uses the binary number system base-2 as the basic number to design electronics circuits that operate with only two voltage levels. 1.1.1 Decimal Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 13.  In binary system, there are only two symbols or possible digit values, 0 and 1.  Even so, this base-2 system can be used to represent any quantity that can be represented in decimal or other number systems.  All the statements made ealier concering the decimal system are equally applicable to the binary system.  The binary system is also a positional-value system, where in each binary digit has its own value or weight expressed as a power of 2. 1.1.2 Binary Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 14.  Example: • Here,places to the left of the binary point (counterpart of the decimal point) are positive power of 2 and places to the right are negative power of 2.  Exercise : Find the equivalent in the decimal system for the number 1011.1012 Answer : 11.62510 (How?) 1.1.2 Binary Number System 1 0 1 1 . 1 0 1 MSB LSB Binary Point 2 3 2 2 2 1 2 0 2 -1 2 -2 2 -3 Figure 2 : Binary position values as power of 2 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 15.  In the binary system, the term binary digit is often abbreviated to the term bit, which we will use henceforth. 1.1.2 Binary Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 16. 1.1.2 Binary Number System EE202 SEMICONDUCTOR DEVICES Figure 3 : Binary Counting Sequence = 8 = 4 = 2 = 1 Decimal equivalent 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 2 3 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 4 5 6 7 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 1 8 9 10 11 1 1 1 1 1 1 1 1 0 0 1 1 0 1 0 1 12 13 14 15 2 3 2 2 2 1 2 0Weights LSB
  • 17.  Example: What is the largest number that can be represented using 8 bits?  Solution : 2 N - 1 = 2 8 -1 = 25510 = 111111112 1.1.2 Binary Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 18.  Review Questions: 1. What is the decimal equivalent of 11010112? 2.What is the next binary number following 101112 in the counting sequence? 3.What is the largest decimal value that can be represented using 12 bits? 1.1.2 Binary Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 19.  A Binary number can be converted to decimal by multiplying the weight of each position with the binary digit and adding together.  Example : Convert the Binary number 101102 to its Decimal equivalent.  Solution: Binary number 1 0 1 1 02 2 4 + 2 3 + 2 2 + 2 1 + 2 0 (2 4 x 1)+(2 3 x 0)+(2 2 x 1)+(2 1 x 1)+(2 0 x 0 ) = 16 + 0 + 4 + 2 + 0 = 2210 1.1.3 Binary to Decimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 20.  Example : Convert the Fractional Binary Number 101.102 to its Decimal equivalent.  Solution: Binary Number = 1 0 1 . 1 0 Power of 2 position = 2 2 2 1 2 0 . 2 -1 2 -2 = (2 2 x 1)+(2 1 x 0)+(2 0 x 1) . (2 -1 x 1)+(2 -2 x 0 ) Decimal Value = 4 + 0 + 1 . 0.5 + 0 = 5.5 10 1.1.3 Binary to Decimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 21. 1.1.3 Binary to Decimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 22. 1.1.3 Decimal To Binary conversion  The most convenient method is called division by 2 method.  In which first decimal number will be divided by 2.  The quotient will be dividend for the next step. In each step the remainder part will be recorded separately.  The 1st reminder of the 1st division will be the LSB in the Binary Number.  The quotient should repeatedly divide by 2 until the quotient becomes 0.  The final remainder will be the MSB in Binary number. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 23.  Example : Convert Decimal 2010 to its Binary equivalent. Solution: 2 20 remainder of 0 2 10 remainder of 0 2 5 remainder of 1 2 2 remainder of 0 2 1 remainder 0f 1 0 1 0 1 0 02 1.1.3 Decimal To Binary conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 24.  When converting a decimal fractional number to its binary, the decimal fractional part will be multiply by 2 till the fractional part gets 0 or till the number of decimal places reached. 1.1.3 Decimal To Binary conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 25.  Below example show the steps to convert decimal fraction 0.625 to its binary equivalent. Step 1 : 0.625 will be multiply by 2 ( 0.625 x 2 = 1.25) Step 2 : The integer part will be the MSB in the binary result Step 3 : The fractional part of the earlier result will be multiply again ( 0.25 x 2 = 0.5 ) Step 4 : Each time after the multiplication the integer part of the result will be written as the Binary number. Step 5 : The procedure should continue till the fractional part gets 0. 1.1.3 Decimal To Binary conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 26.  Example : Convert Decimal 0.62510 to its binary equivalent. Solution: 0.25 x 2 = 0.50 0. 5 x 2 = 1. 00 LSB carried MSB 1 0 1 = 0.62510 = . 1012 1.1.3 Decimal To Binary conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 27.  Example : Convert Decimal 3610 to its Binary equivalent. Solution: 2 36 remainder of 0 2 18 remainder of 0 2 9 remainder of 1 2 4 remainder of 0 2 2 remainder 0f 0 2 1 remainder 0f 1 0 1 0 0 1 0 02 Review Questions: DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 28. 1.1.4 Binary Addition  Adding of two binary numbers follows same as addition of two decimal numbers.  Some times binary addition is very much easier then Decimal or any other number system addition, because in binary you deal with only 2 numbers.  There are mainly 4 rules should be followed in the process of addition in binary numbers: sum carryout Rule 1 : 0 + 0 = 0 0 Rule 2 : 0 + 1 = 1 1 Rule 3 : 1 + 0 = 1 1 Rule 4 : 1 + 1 = 0 1 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 29. Example: Perform Binary Addition for 1012 + 0102 Solution: 1 0 12 0 1 02 + 1 1 1 Exercise: Perform Binary Addition for 10112 + 01112 Answer: 10 01 02 1.1.4 Binary Addition DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 30.  When subtracting one binary number A (subtrahend) from another binary number B (Minuend) where B > A, the answer is called the difference.  There are four basic rules that should be followed in binary subtracting To perform Rule 2 you have to borrow 1 from the next left column.  The weight of the binary you borrow will be 2. 1.1.5 Binary Subtraction DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 31.  Minuend (B) Subtrahend (A) Difference Borrow out  Rule 1 0 - 0 = 0  Rule 2 0 - 1 = 1 with a borrow of 1  Rule 3 1 - 0 = 1  Rule 4 1 - 1 = 0 Example: Subtract binary 1012 from 1102 0 1 1 0 1 0 1 0 0 1 = 0012 1.1.5 Binary Subtraction DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 32. 1.1.8 Signed Binary Numbers  A signed number consist both positive and negative sign with magnitude.  The additional bit for representing the sign of the number (+ or -) is known as sign bit.  in general, 0 in the sign bit represents a positive number and 1 in the sign bit represents a negative number.  The leftmost bit 0 is the sign bit represent +  The leftmost bit 1 is the sign bit represent - DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 33.  Therefore the stored number in register A and B is 13 and -13 respectively in Decimal form.  The signed bit is used to indicate the positive or negative nature of the stored binary numbers.  Here the magnitude bits are the binary equivalent of the decimal value being represented.  This is called the sign magnitude system. 1.1.8 Signed Binary Numbers DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 34. 1.1.8 Signed Binary Numbers  Sign bit (+) A4 A3 A2 A1 A 0 = +13 B4 B3 B2 B1 B0 = - 13 Representing Signed Number 0 1 1 0 1 1 1 1 0 1 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 35. Example:  Express the Decimal number -46 in 8 bit Signed magnitude system Solution: True Binary number for +46 = 00101110 Change the sign bit to 1 and remain unchanged magnitude nits = 10101110 = -46 1.1.8 Signed Binary Numbers DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 36. 1.2 Octal Number System  Octal number has eight possible symbols: 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 and used to express binary numbers, which is called as base of 8 number system or Radix of 8.  Figure: illustrated how it decrease with negative power of 8: 8 5 8 4 8 3 8 2 8 1 8 0 . 8 -1 8 -2 8 -3 8 -4 8 -5 Decrease with negative power of 8 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 37. 1.2.2 Octal to Binary Conversion  Any octal number can be represent by 3 bit binary number, such as 0002 to represent 08 and 111 2 to represent 78 Example: Convert 4358 to its Binary equivalent. Solution: 4 3 58 100 011 101 = 1000111012 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 38.  Exercise: Convert 54.78 to its Binary equivalent. Solution : 5 4 . 78 101 100 . 111 = 101100.1112 1.2.2 Octal to Binary Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 39. 1.2.1 Binary to Octal Conversion  This is the reverse form of the octal to binary conversion.  First, the Binary number should be divided into group of three from LSB.  Then each three-bit binary number is converted to an Octal form. Example: Convert 1001010112 to its equivalent Octal number. Solution: 100 101 011 4 5 3 = 4 5 38 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 40.  Sometimes the Binary numberwill not have even groups of 3 bits.  For those cases, we can add one or two 0s to the left of the MSB of the binary number to fill out the last group. Example: Convert 110101102 to its equivalent Octal number. Solution: 011 010 110 3 2 68 =3268 NOTE that a 0 was placed to the left of the MSB to produce even groups of 3 Bits. 1.2.1 Binary to Octal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 41.  Octal number can be converted to decimal by multiplying the weight of each position with the octal number and adding together.  Example: Convert the Octal number 2578 to its decimal equivalent  Solution: 2578 = (2 x 8 2 )+ (5 x 8 1 )+ (7 x 8 0 ) = (2 x 64) + (5 x 8) + (7 x 1) = 17510 1.2.2 Octal Number to Decimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 42.  Exercise : Convert the Octal number 17.78 to its Decimal equivalent Solution: 17.78 = (1 x 8 1 ) + (7 x 80) + (7 x 8 -1 ) = (1 x 8) + (7 x 1) + (7 x .125) = 15.87510 1.2.2 Octal Number to Decimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 43.  Here we can apply the same method done in decimal to binary conversion. Dividing the decimal number by 8 can do conversion to octal. Example : Convert 9710 to its Octal equivalent. Solution : 8 97 + remainder of 1 8 12 + remainder of 4 8 1 + remainder of 1 0 1 4 18 1.2.2 Decimal to Octal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 44. Review Question: 1. Convert 6148 to decimal. 2. Convert 14610 to Octal, then from Octal to Binary. 3. Convert 100111012 to Octal. 4. Convert 97510 to Binary by First Coverting to Octal. 5. Convert Binary 10101110112 to Decimal by first converting to Octal. Answer: 1. 396 2. 222, 010010010 3. 235 4. 1111001111 5. 699 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 45. 1.3 Hexadecimal Number System  Hexadecimal number system is called as base 16 number system.  It uses 10 decimal numbers and 6 alphabetic characters to represent all 16 possible symbols.  Table below, shows Hexadecimal numbers with its equivalent in decimal and Binary. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 46. Hexadecimal Number Binary Number Decimal Nmber 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 0111 7 8 1000 8 9 1001 9 A 1010 10 B 1011 11 C 1100 12 D 1101 13 E 1110 14 F 1111 15 1.3 Hexadecimal Number System DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 47. 1.3.1 Hexadecimal to Binary Conversion  Hexadecimal number can be represent in Binary form by using 4 bits for each hexadecimal number. 016 can be written in binary = 0000 716 in binary can be written = 0111 A16 in binary can be written = 1010 Example: Convert the Hexadecimal A516 to its Binary equivalent. Solution : A 516 1010 01012 = 101001012 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 48. Exercise: Convert the Hexadecimal 9F216 to its Binary equivalent. Solution: 9 F 2 1001 1111 0010 = 1001111100102 1.3.1 Hexadecimal to Binary Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 49.  This is the reverse form of the Hexadecimal to Binary Conversion.  First the Binary number should be Divided into group of Four bits from LSB.  Then each four-bit binary number is converted to a Hexadecimal form. 1.3.1 Binary to Hexadecimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 50.  Example: Convert the Binary 10110110111110102 to its equivalent Hexadecimal number. Solution: 1011 0110 1111 1010 B 6 F A = B6FA16 1.3.1 Binary to Hexadecimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 51.  Exercise: Convert the Binary 11101001102 to its equivalent Hexadecimal number. Solution: 0011 1010 01102 3 A 6 = 3A616 1.3.1 Binary to Hexadecimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 52. 1.3.2 Hexadecimal to Decimal Conversion  Hexadecimal number can be converted to decimal by multiplying the weight of each position of the hexadecimal number (power of 16) and adding togather. Example: Convert the Hexadecimal number 32716 to its Decimal Equivalent. Solution : 32716 = (3 x 16 2 ) + (2 x 16 1 ) + (7 x 16 0 ) = ( 3 x 256) + ( 2 x 16 ) + ( 7 x 1 ) = 80710 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 53. Example : Convert the Hexadecimal number 2AF16 to its Decimal Equivalent. Solution: 2AF16 = (2 x 162)+(10 x 161 )+(15 x 160 ) = (512) + (160) + (15) = 68710 1.3.2 Hexadecimal to Decimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 54.  Exercise : Convert the Hexadecimal number 1BC216 to its Decimal Equivalent. Solution: = (1 x 16 3 )+(11 x 16 2 )+(12 x 16 1 )+(2 x 16 0 ) = 710610 1.3.2 Hexadecimal to Decimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 55.  Here we can apply the same method done in Decimal to Binary conversion.  Since we need to convert to Hexadecimal, so we have to divide the Decimal number by 16.  Example : Convert the Decimal 38210 to its Hexadecimal equivalent. Solution: 16 382 + remainder of 14 16 23 + remainder of 7 0 7 E16 1.3.2 Decimal to Hexadecimal Conversion DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 56. Counting Hexadecimal  When counting in Hex, each digit position can be incremented (increased by 1) from 0 to F.  Once a digit position reaches, the value F, it is RESET to 0 and the next digit position is incremented.  This illustrated in the following Hex counting sequences. (a). 38, 39, 3A, 3B, 3C, 3D, 3E, 3F, 40, 41, 42 (b). 6F8, 6F9, 6FA, 6FB, 6FC, 6FD, 6FE, 6FF, 700 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 57. Review Question: 1. Convert 24CE16 to Decimal. 2. Convert 311710 to Hex, then from Hex to Binary. 3. Convert 10010111101101012 to Hex. 4. Write the next four numbers in this Hex counting sequence. E9A, E9B, E9C, E9D, ___,___,___,___ 5. Convert 35278 to Hex. Answer: 1. 9422 2. C2D ; 110000101101 3. 97B5 4. E9E, E9F, EA0, EA1 5. 757 DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 58. 1.3.3 1's Complement Form  The 1's complement form of any binary number is simply obtained by taking the complement form of 0 and 1.  1 to 0 and 0 to 1 * The range is –(2n-1 – 1) to +(2n-1-1). Example: Find the 1's complement 101001 Solution: 1 0 1 0 0 1 Binary Number 0 1 0 1 1 0 1's complement of Binary Number DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 59.  The 2's complement form of binary number is obtained by taking the complement form of 0, 1 and adding 1 to LSB.  The range is –(2n-1) to (2n-1-1). Example: Find the 2's complement of 1110010 Solution: 1 1 1 0 0 1 0 Binary Number 0 0 0 1 1 0 1 1's complement + 1 Add 1 0 0 0 1 1 1 0 2's complement 1.3.3 2's Complement Form DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 60. 1.3.3 Signed Number Representing Using 2's Complement Example: Express the Decimal number -25 in the 2's complement system using 8-bits. Solution: Represent the +25 in Binary for 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 ( 1's complement) +1 1 1 1 0 0 1 1 1 ( 2's complement) DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 61. 1.3.3 2's complement Addition  The two number in addition are addend and augend which result in the sum.  The following five cases can be occur when two binary numbers are added; CASE 1: Both number are positive Straight Foward addition. Example: +8 and +4 in 5 bits 0 1000 ( + 8, augend) 0 0100 ( + 4, addend) 0 1 1 0 0 ( sum = + 12) signed bit DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 62.  CASE 2: Positive number larger than negative number Example: Add two numbers +17 and -6 in six bits Solution: 0 1 0 0 0 1 (+17) 1 1 1 0 1 0 (-6) 1 0 0 1 0 1 1 (+11) The Final carry bit is disregarded 1.3.3 2's complement Addition DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 63.  CASE 3: Positive number smaller than negative number  Example:  Add two numbers -8 and +4 Solution: 1 1 0 0 0 ( -8, augend) 0 0 1 0 0 ( +4, addend) 1 1 1 0 0 ( sum = -4) sign bit 1.3.3 2's complement Addition Since the SUM is negative, it is in 2's complement form. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 64.  Case 4: Both numbers are negative Example: Add two numbers -5 and -9 in 8 bits. Solution: 1 1 1 1 1 0 1 1 (-5) + 1 1 1 1 0 1 1 1 (-9) 1 1 1 1 1 0 0 1 0 (-14) The final carry bit is disregarded 1.3.3 2's complement Addition Since the SUM is negative, it is in 2's complement form. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 65.  when subtracting the binary number ( the subtrahend) from another binary number ( the minuend) then change the sign of the subtrahend and adds it to the minuend. Case 1: Both numbers are positive : Example: Subtract +41 from +75 in byte. Solution: Minuend ( +75) = 01001011 Subtrahend (+41)=00101001 Take the 2's complement form of subtrahend (+41) and add with miuend. 1.3.3 2's complement Subtraction DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 66. 0 1 0 0 1 0 1 1 (+75) 1 1 0 1 0 1 1 1 (-41) 1 0 0 1 0 0 0 1 0 (+34) discard 1.3.3 2's complement Subtraction DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 67.  CASE 2: Both numbers are negative Example: Subtract -30 from -80 in 8bit. Solution: In this case (-80) - (-30) = ( -80) + (30) 1 0 1 1 0 0 0 0 (-80) - 0 0 0 1 1 1 1 0 (+30) 1 1 0 0 1 1 1 0 (-50) 1.3.3 2's complement Subtraction DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 68.  CASE 3 : Both numbers are opposite sign Example: Subtract -20 from + 24 in byte. Solution: In this case (+24) - (-20) = (+24)+(20) 0 0 0 1 1 0 0 0(+24) 0 0 0 1 0 1 0 0 (+20) 0 0 1 0 1 1 0 0 (+44) 1.3.3 2's complement Subtraction DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 69. 1.4 How Binary CODES are Used in Computers  Binary codes are used in computers representing Decimal digits, alphanumeric characters and symbols.  When Numbers, letters or words are represented by a speacial group of symbols, we say that they are being encoded, and the group of symbols is called a code.  When a decimal number is represented by its equivalent binary number, we call it Straight Binary Coding. DEE2034 DIGITAL ELECTRONICS
  • 70.  BCD- Binary Coded Decimal Code  If each digit of a decimal number is represented by its binary equivalent, the result is a code called Binary Coded Decimal , BCD.  To illustrate the BCD code, take a Decimal number such as 874.  Each digit is changed to its Binary Equivalent as follows : 8 7 4 (Decimal) 1000 0111 0100 (BCD) 1.4.1 BCD 8421 codes DEE2034 DIGITAL ELECTRONICS
  • 71.  As another example, let us change 943 to its BCD- code representation: 9 4 3 (Decimal) 1001 0100 0011 ( BCD)  Once again, each decimal digit is changed to its straight Binary equivalent.  Note that 4 Bits are always used for each digit.  The BCD code, then represents each digit of the decimal number by a 4 Bit binary number. 1.4.1 BCD 8421 codes DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 72.  Clearly only the 4-bit binary numbers from 0000 through 1001 are used.  The BCD code does not use the numbers 1010, 1011, 1100, 1101, 1110 and 1111.  In other words, only 10 of the 16 possible 4-bit binary code groups are used.  If any of the "forbidden" 4-bit numbers ever occurs in a machine using the BCD code, it is usually an indication that an error has occurred. 1.4.1 BCD 8421 codes DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 73. Example: Convert 0110100000111001 (BCD) to its decimal equivalent. Solution: Divide the BCD number into 4-bit groups and convert each to decimal. 0110 1000 0011 1001 6 8 3 9 1.4.1 BCD 8421 codes DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 74. Exercise: Convert the BCD number 011111000001 to its Decimal equivalent. Solution: 0111 1100 0001 7 1 Forbidden code group indicates error in BCD number 1.4.1 BCD 8421 codes DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 75. 1.4.1 Comparison of BCD and Binary  It is important to realize that BCD is not another number system like binary, octal, decimal and Hexadecimal.  It is also important to understand that a BCD number is not the same as a straight binary number.  A straight binary code takes the complete decimal number and represents it in binary.  BCD code converts each decimal digit to binary individually.  Example: 13710 = 100010012 (binary) 13710 = 0001 0011 0111 (BCD) DEE2034 DIGITAL ELECTRONICS
  • 76. 1.4.2 Alphanumeric Codes  A computer should recognize codes that represent letters of the alphabet, puntuation marks, and other special characters as well as numbers.  A complete alphanumeric code would include the 26 lowercase latters, 26 uppercase latter, 10 numeric digits, 7 punctuation marks, and anywhere from 20 to 40 other characters such as + / * # and so on.  we can say that an alphanumeric code represents all of the various characters and functions that are found on a standard typewriter or computer keyboard. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 77.  The most widely used alphanumeric code.  American Standard Code for Information interchange (ASCII).  Pronounced "askee" Refer table next slide to see : Partial Listing of ASCII code. 1.4.2 Alphanumeric Codes - ASCII Code DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 78. ASCII Reference Table DEE2034 DIGITAL ELECTRONICS
  • 79. Extended ASCII Codes DEE2034 DIGITAL ELECTRONICS
  • 80. Example: The following is a message encoded in ASCII code. What is the message? 1001000 1000101 1001100 1010000 Solution: Convert each 7-bit code to its Hexadecimal equivalent. The results are : 48 45 4C 50 Now, locate these Hexadecimal values in table ASCII and determine the character represented by each. The results are: H E L P 1.4.2 Alphanumeric Codes - ASCII Code sabariah@psa.edu.my www.baiasalihin.com
  • 81. References  "Digital Systems Principles And Application" Sixth Editon, Ronald J. Tocci.  "Digital Systems Fundamentals" P.W Chandana Prasad, Lau Siong Hoe, Dr. Ashutosh Kumar Singh, Muhammad Suryanata. DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com
  • 82. The End Of Chapter 1...  Do Review Questions  Quiz 1 for Chapter 1- be prepared!! DEE2034 DIGITAL ELECTRONICSsabariah@psa.edu.my www.baiasalihin.com