DLD Lecture 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Digital Logic Design

Dr. Irfan Yousuf


Department of Computer Science (New Campus)
UET, Lahore
(Lecture # 3; March 01, 2020)
Outline
• Modern Computer Systems
• Boolean Algebra
Modern Computer Systems

• Computer systems can be viewed at several layers of


abstraction from circuits to algorithms, with each higher
layer of abstraction hiding the details and complexity of the
layer below.
• Abstraction removes unnecessary implementation details
about a component in the system so that a designer can
focus on the aspects of the component that matter for the
problem being solved.
Modern Computer Systems
Types of Digital Systems

Digital System

Combinational Logic Sequential Logic


(No Internal State) (Internal State)
Output = F (Input) Output = F (Input, State)

Synchronous Asynchronous
(State updated at (State updated at
discrete time) any time)
Combinational vs. Sequential Circuits

• Combinational circuit is the type of circuit in which


output only relies on the input present at that instant.

• Sequential circuit is the type of circuit where output


not only relies on the current input but also depends
on the previous output.
Combinational vs. Sequential Circuits
Signal
• To show the existence of something
• To inform something
• an observable change

• a function that conveys information about a phenomenon.


• In electronics and telecommunications, it refers to any time varying
voltage, current or electromagnetic wave that carries information
Signal
• An information variable represented by physical quantity.
• For digital systems, the variable takes on discrete values.
• Two level, or binary values are the most prevalent values in digital
systems.
• Binary values are represented abstractly by:
• digits 0 and 1
• words (symbols) Low (L) and High (H)
Continuous vs. Discrete

• Continuous: can take any value


• Age, height
• Example: Any value between 1 and 5
• Discrete: can only take certain values
• Number of students in a class
• Example: A value from the set [1, 1.5, 2.5, 4]
Types of Signals
Analog vs. Digital

• Analog: These signals are continuous in both values


and time.
• Digital: These signals are discrete in value and time
Clock Signal
• A special type of signal that oscillates between a
high and a low state.
• A digital circuit follows clock signal to coordinate
its sequence of actions
Synchronous System

A synchronous system is one in which transfer of information


between combinational blocks is performed in synchrony with
a global clock signal.
Types of Digital Systems

Digital System

Combinational Logic Sequential Logic


(No Internal State) (Internal State)
Output = F (Input) Output = F (Input, State)

Synchronous Asynchronous
(State updated at (State updated at
discrete time) any time)
Signal Example – Physical Quantity: Voltage

OUTPUT INPUT
5.0
HIGH HIGH
4.0
3.0
Threshold
2.0 Region
1.0
LOW LOW
0.0
Volts
Arithmetic Operations in Number System

• Arithmetic operations with numbers in base r follow


the same rules as for decimal numbers.
• However, when a base other than the familiar base
10 is used, one must be careful to use only
allowable digits and perform all computations with
base r digits.
Commonly Occurring Bases

Name Radix (r) Digits


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
Arithmetic in Binary Numbers
Arithmetic in Binary Numbers
Arithmetic in Binary Numbers
Arithmetic in Hexadecimal Numbers
Arithmetic in Octal Numbers
Binary Numbers and Binary Coding

• Bit = Binary Digit = 0, 1


• Given n binary digits (called bits), a binary code is a mapping from a
set of represented elements to a subset of the 2n binary numbers.

• If Bit = 1 then we can have 21 binary numbers, i.e, 0, 1


• If Bit = 2 then we can have 22 binary numbers, i.e, 00, 01, 10, 11
Binary Numbers and Binary Coding
Binary Code
• An n-bit binary code is a group of n bits that assume
up to 2n distinct combinations of 1s and 0s, with
each combination representing one element of the
set being coded.
• The bit combinations of an n-bit code can be
determined from the count in binary from 0 to 2n - 1
• Each element must be assigned a unique binary bit
combination, and no two elements can have the
same value; otherwise, the code assignment is
ambiguous.
Binary Coded Decimal (BCD)
Binary coded decimal (BCD) is a system of writing
numerals that assigns a four-digit binary code to each
digit 0 through 9 in a decimal (base-10) numeral.
Binary Coded Decimal (BCD)
▪ A BCD number greater than 10 has a representation
different from its equivalent binary number, even
though both contain 1s and 0s.
▪ Moreover, the binary combinations 1010 through
1111 are not used and have no meaning in the BCD
code.
Alphanumeric Code

• Many applications of digital computers require the handling


of data consisting not only of numbers, but also of letters.
• To represent the names and other pertinent information, it is
necessary to formulate a binary code for the letters of the
alphabet.
• Any alphanumeric character set for English is a set of
elements that includes the ten decimal digits, the 26 letters
of the alphabet, and several (more than three) special
characters.
ASCII Code
▪ The standard binary code for the alphanumeric
characters is called ASCII (American Standard Code for
Information Interchange).
▪ It uses seven bits to code 128 characters
Parity Bit

• To detect errors in data communication and


processing, an additional bit is sometimes added to a
binary code word to define its parity.
• A parity bit is the extra bit included to make the total
number of 1s in the resulting code word either even
or odd.
Gray Code
• A Gray code is an encoding of numbers so that adjacent
numbers have a single digit differing by 1.
• The term Gray code is often used to refer to a "reflected"
code, or more specifically still, the binary reflected Gray
code.
Gray Code
Gray Code
Conversion or Coding?

• Do NOT mix up conversion of a decimal number


to a binary number with coding a decimal
number with a BINARY CODE.
• 1310 = 11012 (This is conversion)
• 13  0001|0011 (This is coding)
Summary
• Binary Coding

You might also like