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

Lecture1 Chapter1 - Introduction To Digital Systems

This document provides an introduction to digital systems and binary numbers. It begins with an overview of analog versus digital systems and how digital systems use discrete binary values represented by 1s and 0s. It then discusses the history and importance of number systems, focusing on binary and how binary numbers are represented using powers of two. Finally, it covers basic concepts like binary addition and fractions in binary.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

Lecture1 Chapter1 - Introduction To Digital Systems

This document provides an introduction to digital systems and binary numbers. It begins with an overview of analog versus digital systems and how digital systems use discrete binary values represented by 1s and 0s. It then discusses the history and importance of number systems, focusing on binary and how binary numbers are represented using powers of two. Finally, it covers basic concepts like binary addition and fractions in binary.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Chapter1: Digital Systems and Binary

Numbers
Lecture1- Introduction to Digital Systems
Engr. Arshad Nazir, Asst Prof
Dept of Electrical Engineering
EE-223 Digital Logic Design Spring 2024 SEECS 1
Chapter Contents
Digital Systems
Binary Numbers
Number Base Conversion
Octal and Hexadecimal Numbers
Complements
Signed Binary Numbers
Binary Codes
Binary Storage and Registers
Binary Logic and Logic Gates
Timing Diagrams

EE-223 Digital Logic Design Spring 2024 2


Objectives
• Introduction to Digital Systems
• History of Number Systems
• Study Commonly Used Number Systems

EE-223 Digital Logic Design Spring 2024 3


Analog and Digital Systems
• Real world is analog but digital circuits are found in an astonishingly wide range of
electronic systems.
• Analog systems process information that varies continuously . Examples of analog
represented variables are:
➢ a mercury thermometer
➢ needle speedometer of cars
➢ sine wave voltages indicated on a galvanometer
➢ audio amplifier
➢ simple light dimmer switch
• Digital systems process discrete information. Discrete means distinct or separated as
opposed to continuous or connected. The examples are:
➢ telephone switching exchanges
➢ Speedometer of cars with numerical readout
➢ electronic calculators
➢ ten position switch
EE-223 Digital Logic Design Spring 2024 4
➢ digital computers
Analog and Digital Systems

Analog watch Digital watch

Figure: A basic audio public address system


EE-223 Digital Logic Design Spring 2024 5
Analog and Digital Systems
• Analog systems process signals • Digital system use discrete set of
that take on continuous range of values that can be represented by
values. Examples are 1’s and 0’s. Examples are

Digital Multimeter

Digital thermometer
EE-223 Digital Logic Design Spring 2024 6
Analog and Digital Systems

Figure: Block diagram of a CD player

EE-223 Digital Logic Design Spring 2024 7


Digital Systems
• Digital Systems have such a prominent role in everyday life that we refer to the present
technological period as the digital age.
• Digital systems manipulate discrete elements of information and have wide applications.
➢ Digital systems are used in communication, business transactions, traffic control,
space guidance, medical treatment, weather monitoring, the Internet, and many
other commercial, industrial, and scientific enterprises.
➢ We have digital telephones, digital television, digital versatile discs, digital cameras,
and digital computers.
• The discrete elements of information are represented in a digital system by physical
quantities called signals i.e voltage and current.
• The signals in present-day electronic digital systems use just two discrete values and are
therefore said to be binary. A binary digit, called a bit, has two values: 0 and 1.
• Why binary?
➢ reliability: a transistor circuit is either ON or OFF (two stable states)

EE-223 Digital Logic Design Spring 2024 8


Digital Systems
• Digital Systems represent systems that understand, represent and
manipulate discrete elements.
➢ A discrete element is any set that has a finite number of elements, for
example 10 decimal digits, 26 letters of the alphabet, etc.
• Discrete elements are represented by signals, such as electrical signals
(voltages and currents)
• The signals in most electronic digital systems use two discrete values,
termed as binary.
• Digital Systems take a set of discrete information inputs and discrete
internal information (system state) and generates a set of discrete
information outputs.

EE-223 Digital Logic Design Spring 2024 9


Digital Systems

Discrete Discrete
Inputs Information
Processing
System Discrete
Outputs

System State

EE-223 Digital Logic Design Spring 2024 10


Why Digital Components?
• Why do we choose to use digital components?
➢ The main reason for using digital components is that they can
easily be programmed, allowing a single hardware unit to be used
for many different purposes.
➢ Advances in circuit technology decrease the price of technology
dramatically.
➢ Digital integrated circuits can perform at speeds of hundreds of
millions of operations per second.
➢ Error-checking and correction can be used to ensure the reliability
of the machine.

EE-223 Digital Logic Design Spring 2024 11


Binary Digits
• A binary digit, called a bit, is represented by Decimal Binary Code
one of two values: 0 or 1. 0 0000
➢ Discrete elements can be represented by 1 0001
groups of bits called binary codes. For 2 0010
example, the decimal digits 0 to 9 are 3 0011
represented as follows: 4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

EE-223 Digital Logic Design Spring 2024 12


Different Bases
• In order to represent numbers of different bases, we surround a
number in parenthesis and then place a subscript with the base of
the number. Few examples of different number bases are:
➢ A decimal number→ (9233)10
➢ A binary number → (11011)2
➢ A base 5 number →(3024)5
• Decimal number digits are 0 through 9
• Binary number digits are 0 through 1
• Base 5 number digits are 0 through 4
• Base (radix) r number digits are 0 through r - 1

EE-223 Digital Logic Design Spring 2024 13


Commonly Used Bases
Name Radix Digits (0 through r-1)
Binary 2 0,1
Octal 8 0,1,2,3,4,5,6,7
Decimal 10 0,1,2,3,4,5,6,7,8,9
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

EE-223 Digital Logic Design Spring 2024 14


Decimal Numbers
• A decimal number such as 5723 represents a quantity equal to:
➢ 5 thousands
➢ 7 hundreds
➢ 2 tens
➢ 3 ones
• Or it can be written as:
5 x 103 + 7 x102 + 2 x101 + 3 x 100
• The 5, 7, 2, and 3 represent coefficients.
• The decimal number system is said to be of base or radix 10 because
it uses the 10 digits (0...9) and the coefficients are multiplied by
powers of 10.

EE-223 Digital Logic Design Spring 2024 15


Binary Numbers
• The binary system contains only two values in the allowed
coefficients (0 and 1).
• The binary system uses powers of 2 as the multipliers for the
coefficients.
• For example, we can represent the binary number 10111.012 as:
1 X 24 + 0 X 23 + 1 X 22 + 1 X 21 + 1 X 20 + 0 X 2-1 + 1 X 2-2 = 23.2510

EE-223 Digital Logic Design Spring 2024 16


Understanding Binary Numbers
• Binary numbers are made of binary digits (bits):
0 and 1
• How many items does a binary number represent?
(1011)2 = 1x23 + 0x22 + 1x21 + 1x20 = (11)10
• What about fractions?
(110.10)2 = 1x22 + 1x21 + 0x20 + 1x2-1 + 0x2-2
• Groups of eight bits are called a byte
(11001001) 2
• Groups of four bits are called a nibble.
(1101) 2

EE-223 Digital Logic Design Spring 2024 17


Understanding Binary Numbers (Cont…)
• Each digit (bit) is either 1 or 0 MSB LSB
1011001010011100
• Each bit represents a power of 2
15 0
• Bit numbering
• MSB: most significant bit 1 1 1 1 1 1 1 1
• LSB: least significant bit 27 26 25 24 23 22 21 20
Why Binary Numbers?
• Easy to represent 0 and 1 using electrical values.
• Possible to tolerate noise.
• Easy to transmit data
• Easy to build binary circuits.

EE-223 Digital Logic Design Spring 2024 18


Powers of Two

Important Powers of Two are:


➢ 210 is referred to as Kilo, called "K"
➢ 220 is referred to as Mega, called "M"
➢ 230 is referred to as Giga, called "G”
➢ 240 is referred to as Tera, called “T”

EE-223 Digital Logic Design Spring 2024 19


Octal Numbers
• The octal number system is a base-8 system that contains the
coefficient values of 0 to 7.
• The octal system uses powers of 8 as the multipliers for the
coefficients.
• For example, we can represent the octal number 720328 as:
7 X 84 + 2 X 83 + 0 X 82 + 3 X 81 + 2 X 80 = (29722)10

EE-223 Digital Logic Design Spring 2024 20


Hexadecimal Numbers
• The hexadecimal number system is a base-16 system that contains
the coefficient values of 0 to 9 and A to F.
• The letters A, B, C, D, E, F represent the coefficient values of 10, 11,
12, 13, 14, and 15, respectively.
• The hexadecimal system uses powers of 16 as the multipliers for the
coefficients.
• For example, we can represent the hexadecimal number C34D16 as:
➢ 12 X 163 + 3 X 162 + 4 X 161 + 13 X 160 = (49997)10

EE-223 Digital Logic Design Spring 2024 21


EE-223 Digital Logic Design Spring 2024 22
Conversion between bases
• To convert from one base to other:
➢ Convert the integer portion
➢ Convert the fraction portion
➢ Join the two with radix point Octal (base 8)

Binary (base 2) Decimal (base 10)

Hexadecimal
(base16)
EE-223 Digital Logic Design Spring 2024 23
Decimal-r Conversion
• Conversion of a number in base r to decimal is done by expanding the number in
a power series and adding all the terms.
• For example, (C34D)16 is converted to decimal:
12 X 163 + 3 X 162 + 4 X 161 + 13 X 160 = (49997)10
• (11010.11)2 is converted to decimal:
1 X 24 + 1 X 23 + 0 X 22 + 1 X 21 + 0 X 20 + 1 X 2-1 + 1 X 2-2 = 26.75
• In general N=(Number)r = (a n-1 a n-2 … a1 a 0 . a -1 a -2 … a -m )r
(Integer Portion) + (Fraction Portion)
N= (a n-1 x r n-1 +a n-2 x r n-2 +… +a1 x r 1+a 0 x r 0+a x r -1 +a x
-1 -2 r -2 +…+a -m x r -m)10

( i = n −1
i =0
ai • r i + ) ( j =−1
a
j =− m j
• r j
)

EE-223 Digital Logic Design Spring 2024 24


Decimal-r Conversion
• If a decimal number has a radix point, it is necessary to separate the
number into an integer part and a fraction part.
• The conversion of a decimal integer into a number in base-r is done by
dividing the number and all successive quotients by r and
accumulating the remainders in reverse order of computation.
• For example, to convert decimal 13 to binary:
Integer Remainder Coefficient
Quotient

13/2 = 6 + ½ a0 = 1
6/2 = 3 + 0 a1 = 0
3/2 = 1 + ½ a2 = 1
1/2 = 0 + ½ a3 = 1

Answer (13)10 = (a3 a2 a1 a0)2 = (1101)2

EE-223 Digital Logic Design Spring 2024 25


Decimal to Binary Conversion

EE-223 Digital Logic Design Spring 2024 26


Decimal to Binary Conversion
Example
• Convert (37)10 to binary

(37)10 = 1001012

EE-223 Digital Logic Design Spring 2024 27


Decimal-r Conversion (Converting
Fractions)
• To convert the fraction portion repeatedly multiply the fraction by the
radix and save the integer digits that result. The process continued
until the fraction becomes 0 or the number of digits have sufficient
accuracy. The new radix fraction digits are the integer digits in
computed order.
• For example convert fraction (0.6875)10 to base 2
0.6875 * 2 = 1.3750 integer = 1
0.3750 * 2 = 0.7500 integer = 0
0.7500 * 2 = 1.5000 integer = 1
0.5000 * 2 = 1.0000 integer = 1
Answer = (0.1011)2

EE-223 Digital Logic Design Spring 2024 28


Converting Fractions Cont…
• When converting fractions, we must use multiplication rather than
division. The new radix fraction digits are the integer digits in
computed order.

EE-223 Digital Logic Design Spring 2024 29


Another example:
• Convert 0.8125 decimal to binary.
➢ To convert the decimal 0.8125
to binary, we multiply by the
radix 2.
➢ (0.1101)2

EE-223 Digital Logic Design Spring 2024 30


Decimal to Octal Conversion
• In converting decimal to octal we must divide integer part by 8 till
quotient becomes lesser than divisor.

EE-223 Digital Logic Design Spring 2024 31


Converting Fractions (Decimal to
Octal)
• Decimal to Octal fraction conversion takes the same approach but it
multiplies by the base 8.

EE-223 Digital Logic Design Spring 2024 32


Converting Decimal to Hexadecimal
• The conversion of a decimal integer into hexadecimal is done by
dividing the number and all successive quotients by 16 and
accumulating the remainders in reverse order of computation.

(422)10 = (1A6)16

EE-223 Digital Logic Design Spring 2024 33


Binary, Octal and Hexadecimal
• Conversions between binary, octal and hexadecimal have an easier
conversion method.
➢ Each octal digit represents 3 binary digits.
➢ Each hexadecimal digit represents 4 binary digits.

EE-223 Digital Logic Design Spring 2024 34


Binary to Octal and back
• Binary to Octal:
➢ Group the binary digits into three-bit groups starting at the radix
point and going both ways, padding with zeros as needed (at the
ends).
➢ Convert each group of three bits to an equivalent octal digit.
• Octal to Binary:
➢ It is done by reversing the preceding procedure
➢ Restate the octal as three binary digits
➢ Start at the radix point and go both ways, padding with zeros as
needed.

EE-223 Digital Logic Design Spring 2024 35


Examples
• Convert (10110001101011.11110000011)2 to Octal
= 010 110 001 101 011 . 111 100 000 110
= 2 6 1 5 3 . 7 4 0 6
= (26153.7406)8
• Convert (673.124)8 to binary
= 110 111 011 . 001 010 100
= (110111011.001010100)2
• Convert (11010100011011) 2
to Octal

EE-223 Digital Logic Design Spring 2024 36


Binary to Hexadecimal and back
• Binary to Hexadecimal:
➢ Group the binary digits into four-bit groups starting at the radix
point and going both ways, padding with zeros as needed (at the
ends)
➢ Convert each group of four bits to an equivalent hexadecimal
digit
• Hexadecimal to Binary:
➢ It is done by reversing the preceding procedure
➢ Restate the hexadecimal as four binary digits
➢ Start at the radix point and go both ways, padding with zeros as
needed

EE-223 Digital Logic Design Spring 2024 37


Examples
• Convert (10110001101011.11110010)2 to hexadecimal
= 0010 1100 0110 1011 . 1111 0010
= 2 C 6 B . F 2
= (2C6B.F2)16
• Convert (306.D)16 to binary
= 0011 0000 0110. 1101
= (001100000110.1101)2
• Convert (11010100011011) 2 to hexadecimal

EE-223 Digital Logic Design Spring 2024 38


Your Turn
• Convert (757.25)10 to Binary, Octal, Hexadecimal, and
Base6.
• Find Decimal Equivalent of the following:-
➢ (1011.11)2
➢ (147.3)8
➢ (A2F)16
➢ (3301.13)6
• Convert (231.3)4 to Base7
• Convert (175.6)8 to Hexadecimal

EE-223 Digital Logic Design Spring 2024 39


Base-r Arithmetic
• Arithmetic operations with numbers in base r follow the same rules
as for decimal numbers.
• When a base other than 10 is used, one must remember to use only
the r-allowable digits.
• The following are some examples:

EE-223 Digital Logic Design Spring 2024 40


Arithmetic Rules
• The sum of two digits are calculated as expected but the digits of the
sum can only be from the r-allowable coefficients.
• Any carry in a sum is passed to the next significant digits to be
summed.
• In subtraction the rules are the same but a borrow adds r (where r is
the base) to the minuend digit.
• The examples of addition and subtraction of binary numbers are
presented in the next slides.

EE-223 Digital Logic Design Spring 2024 41


Binary Addition Rules
Given two binary digits (X,Y), a carry in (Z) we get
the following sum (S) and carry (C):
Carry in (Z) of 0: Z 0 0 0 0
X 0 0 1 1
+Y +0 +1 +0 +1
CS 00 01 01 10

Carry in (Z) of 1: Z 1 1 1 1
X 0 0 1 1
+Y +0 +1 +0 +1
CS 01 10 10 11

EE-223 Digital Logic Design Spring 2024 42


Binary Multiplication
• Multiplication table
0x0=0
0x1=0
1x0=0 0 1 1 1 1
1x1=1
X 1 0 1 0
-----------------------
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0

EE-223 Digital Logic Design Spring 2024 43


Binary Division
• Binary division is similar to decimal division

EE-223 Digital Logic Design Spring 2024 44


Determine Unknown Radix
Example: Determine the base of the number for the following operation to
be correct
54/4=13
Solution: Both sides of the given expression carry unknown radices that we
must determine. Convert both sides into decimal as we have learned
previously
5xr1+4xr0/4xr0=1xr1+3xr0
=5r+4/4=r+3
=5r+4=4r+12
Simplification gives
r=8
After you substitute r=8 in the given expression LHS=RHS. So the
required radix is 8.

EE-223 Digital Logic Design Spring 2024 45


Your Turn
Example: Determine the unknown radix for the following
operation to be correct
(365)r =(194)10

EE-223 Digital Logic Design Spring 2024 46


The End

EE-223 Digital Logic Design Spring 2024 47

You might also like