0% found this document useful (0 votes)
14 views188 pages

Dlca 22itc01 Unit 1

The document covers data representation in digital logic and computer architecture, focusing on various data types, number systems, and binary codes. It explains the concepts of complements, fixed-point and floating-point representations, and error detection codes like parity bits. Additionally, it provides examples of arithmetic operations and the significance of different number systems such as decimal, binary, octal, and hexadecimal.

Uploaded by

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

Dlca 22itc01 Unit 1

The document covers data representation in digital logic and computer architecture, focusing on various data types, number systems, and binary codes. It explains the concepts of complements, fixed-point and floating-point representations, and error detection codes like parity bits. Additionally, it provides examples of arithmetic operations and the significance of different number systems such as decimal, binary, octal, and hexadecimal.

Uploaded by

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

DIGITAL LOGIC AND COMPUTER ARCHITECTURE (22ITC01)

FACULTY: E RAMALAKSHMI
UNIT-II
Data Representation
Data Types
 Registers contain either data or control information
 Control information is a bit or group of bits used to specify the sequence of
command signals needed for data manipulation
 Data are numbers and other binary-coded information that are operated on
 Possible data types in registers:
o Numbers used in computations
o Letters of the alphabet used in data processing
o Other discrete symbols used for specific purposes
 All types of data, except binary numbers, are represented in binary-coded form
 A number system of base, or radix, r is a system that uses distinct symbols for r
digits
 Numbers are represented by a string of digit symbols
 The string of digits 724.5 represents the quantity
7 x 102 + 2 x 101 + 4 x 100 + 5 x 10-1
 The string of digits 101101 in the binary number system represents the quantity
1 x 25 + 0 x 24 + 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 45
 (101101)2 = (45)10
 We will also use the octal (radix 8) and hexidecimal (radix 16) number systems
(736.4)8 = 7 x 82 + 3 x 81 + 6 x 80 + 4 x 8-1 = (478.5)10
(F3)16 = F x 161 + 3 x 160 = (243)10
 Conversion from decimal to radix r system is carried out by separating the
number into its integer and fraction parts and converting each part separately
 Divide the integer successively by r and accumulate the remainders
 Multiply the fraction successively by r until the fraction becomes zero
 Each octal digit corresponds to three binary digits
 Each hexadecimal digit corresponds to four binary digits
 Rather than specifying numbers in binary form, refer to them in octal or
hexadecimal and reduce the number of digits by 1/3 or ¼, respectively
 A binary code is a group of n bits that assume up to 2n distinct combinations
 A four bit code is necessary to represent the ten decimal digits – 6 are unused
 The most popular decimal code is called binary-coded decimal (BCD)
 BCD is different from converting a decimal number to binary
 For example 99, when converted to binary, is 1100011
 99 when represented in BCD is 1001 1001
 The standard alphanumeric binary code is ASCII
 This uses seven bits to code 128 characters
 Binary codes are required since registers can hold binary information only
Complements

 Complements are used in digital computers for simplifying subtraction and logical
manipulation
 Two types of complements for each base r system: r’s complement and (r – 1)’s
complement
 Given a number N in base r having n digits, the (r – 1)’s complement of N is
defined as (rn – 1) – N
 For decimal, the 9’s complement of N is (10n – 1) – N
 The 9’s complement of 546700 is 999999 – 546700 = 453299
 The 9’s complement of 453299 is 999999 – 453299 = 546700
 For binary, the 1’s complement of N is (2n – 1) – N
 The 1’s complement of 1011001 is 1111111 – 1011001 = 0100110
 The 1’s complement is the true complement of the number – just toggle all bits

 The r’s complement of an n-digit number N in base r is defined as rn – N


 This is the same as adding 1 to the (r – 1)’s complement
 The 10’s complement of 2389 is 7610 + 1 = 7611
 The 2’s complement of 101100 is 010011 + 1 = 010100

 Subtraction of unsigned n-digit numbers: M – N


o Add M to the r’s complement of N – this results in
M + (rn – N) = M – N + rn
o If M N, the sum will produce an end carry rn which is discarded
o If M < N, the sum does not produce an end carry and is equal to
rn – (N – M), which is the r’s complement of (N – M). To obtain the
answer in a familiar form, take the r’s complement of the sum and place a
negative sign in front.

Example: 72532 – 13250 = 59282. The 10’s complement of 13250 is 86750.

M = 72352
10’s comp. of N = +86750
Sum = 159282
Discard end carry = -100000
Answer = 59282
Example for M < N: 13250 – 72532 = -59282
M = 13250
10’s comp. of N = +27468
Sum = 40718
No end carry
Answer = -59282 (10’s comp. of 40718)
Example for X = 1010100 and Y = 1000011
X = 1010100
2’s comp. of Y = +0111101
Sum = 10010001
Discard end carry = -10000000
Answer X – Y = 0010001
Y = 1000011
2’s comp. of X = +0101100
Sum = 1101111

No end carry
Answer = -0010001 (2’s comp. of 1101111)

Fixed-Point Representation

 Positive integers and zero can be represented by unsigned numbers


 Negative numbers must be represented by signed numbers since + and – signs are
not available, only 1’s and 0’s are
 Signed numbers have msb as 0 for positive and 1 for negative – msb is the sign bit
 Two ways to designate binary point position in a register
o Fixed point position
o Floating-point representation
 Fixed point position usually uses one of the two following positions
o A binary point in the extreme left of the register to make it a fraction
o A binary point in the extreme right of the register to make it an integer
o In both cases, a binary point is not actually present
 The floating-point representations uses a second register to designate the position
of the binary point in the first register
 When an integer is positive, the msb, or sign bit, is 0 and the remaining bits
represent the magnitude
 When an integer is negative, the msb, or sign bit, is 1, but the rest of the number
can be represented in one of three ways
o Signed-magnitude representation
o Signed-1’s complement representation
o Signed-2’s complement representation

 Consider an 8-bit register and the number +14


o The only way to represent it is 00001110
 Consider an 8-bit register and the number –14
o Signed magnitude: 1 0001110
o Signed 1’s complement: 1 1110001
o Signed 2’s complement: 1 1110010
 Typically use signed 2’s complement

 Addition of two signed-magnitude numbers follow the normal rules


o If same signs, add the two magnitudes and use the common sign
o Differing signs, subtract the smaller from the larger and use the sign of the
larger magnitude
o Must compare the signs and magnitudes and then either add or subtract
 Addition of two signed 2’s complement numbers does not require a comparison or
subtraction – only addition and complementation
o Add the two numbers, including their sign bits
o Discard any carry out of the sign bit position
o All negative numbers must be in the 2’s complement form
o If the sum obtained is negative, then it is in 2’s complement form
+6 00000110 -6 11111010
+13 00001101 +13 00001101
+19 00010011 +7 00000111
+6 00000110 -6 11111010
-13 11110011 -13 11110011
-7 11111001 -19 11101101

 Subtraction of two signed 2’s complement numbers is as follows


o Take the 2’s complement form of the subtrahend (including sign bit)
o Add it to the minuend (including the sign bit)
o A carry out of the sign bit position is discarded

 An overflow occurs when two numbers of n digits each are added and the sum
occupies n + 1 digits
 Overflows are problems since the width of a register is finite
 Therefore, a flag is set if this occurs and can be checked by the user
 Detection of an overflow depends on if the numbers are signed or unsigned
 For unsigned numbers, an overflow is detected from the end carry out of the msb
 For addition of signed numbers, an overflow cannot occur if one is positive and
one is negative – both have to have the same sign
 An overflow can be detected if the carry into the sign bit position and the carry
out of the sign bit position are not equal

+70 0 1000110 -70 1 0111010


+80 0 1010000 -80 1 0110000
+150 1 0010110 -150 0 1101010

 The representation of decimal numbers in registers is a function of the binary


code used to represent a decimal digit
 A 4-bit decimal code requires four flip-flops for each decimal digit
 This takes much more space than the equivalent binary representation and the
circuits required to perform decimal arithmetic are more complex
 Representation of signed decimal numbers in BCD is similar to the representation
of signed numbers in binary
 Either signed magnitude or signed complement systems
 The sign of a number is represented with four bits
o 0000 for +
o 1001 for –
 To obtain the 10’s complement of a BCD number, first take the 9’s complement
and then add one to the least significant digit

 Example: (+375) + (-240) = +135

0 375 (0000 0011 0111 1010)BCD


+9 760 (1001 0111 0110 0000)BCD
0 135 (0000 0001 0011 0101)BCD

Floating-Point Representation

 The floating-point representation of a number has two parts


 The first part represents a signed, fixed-point number – the mantissa
 The second part designates the position of the binary point – the exponent
 The mantissa may be a fraction or an integer
 Example: the decimal number +6132.789 is
o Fraction: +0.6123789
o Exponent: +04
o Equivalent to +0.6132789 x 10+4
 A floating-point number is always interpreted to represent m x re
 Example: the binary number +1001.11 (with 8-bit fraction and 6-bit exponent)
o Fraction: 01001110
o Exponent: 000100
o Equivalent to +(.1001110)2 x 2+4
 A floating-point number is said to be normalized if the most significant digit of
the mantissa is nonzero
 The decimal number 350 is normalized, 00350 is not
 The 8-bit number 00011010 is not normalized
 Normalize it by fraction = 11010000 and exponent = -3
 Normalized numbers provide the maximum possible precision for the floating-
point number

Other Binary Codes


 Digital systems can process data in discrete form only
 Continuous, or analog, information is converted into digital form by means of an
analog-to-digital converter
 The reflected binary or Gray code, is sometimes used for the converted digital
data
 The Gray code changes by only one bit as it sequences from one number to the
next
 Gray code counters are sometimes used to provide the timing sequences that
control the operations in a digital system
 Binary codes for decimal digits require a minimum of four bits
 Other codes besides BCD exist to represent decimal digits

 The 2421 code and the excess-3 code are both self-complementing
 The 9’s complement of each digit is obtained by complementing each bit in the
code
 The 2421 code is a weighted code
 The bits are multiplied by indicated weights and the sum gives the decimal digit
 The excess-3 code is obtained from the corresponding BCD code added to 3

Section 3.6 – Error Detection Codes


 Transmitted binary information is subject to noise that could change bits 1 to 0
and vice versa
 An error detection code is a binary code that detects digital errors during
transmission
 The detected errors cannot be corrected, but can prompt the data to be
retransmitted
 The most common error detection code used is the parity bit
 A parity bit is an extra bit included with a binary message to make the total
number of 1’s either odd or even

 The P(odd) bit is chosen to make the sum of 1’s in all four bits odd
 The even-parity scheme has the disadvantage of having a bit combination of all
0’s
 Procedure during transmission:
o At the sending end, the message is applied to a parity generator
o The message, including the parity bit, is transmitted
o At the receiving end, all the incoming bits are applied to a parity checker
o Any odd number of errors are detected
 Parity generators and checkers are constructed with XOR gates (odd function)
 An odd function generates 1 iff an odd number if input variables are 1
Number systems
 When we type some letters or words, the computer translates
them in numbers as computers can understand only numbers.
A computer can understand positional number system where
there are only a few symbols called digits and these symbols
represent different values depending on the position they
occupy in the number.
 A value of each digit in a number can be determined using
 The digit
 The position of the digit in the number
 The base of the number system (where base is defined as
the total number of digits available in the number system).
2
S.N. Number System and Description
Decimal number system
1
Base 10, Digit used : 0 to 9
Octal Number System
2
Base 8. Digits used : 0 to 7

Hexa Decimal Number System


3
Base 16. Digits used : 0 to 9, Letters used : A- F

4 Binary Number System


Base 2. Digits used : 0, 1
COMPUTER FUNDAMENTAL 3
Decimal Number
systems
 The number system that we use in our day-to-day life is the
decimal number system. Decimal number system has base 10 as
it uses 10 digits from 0 to 9. In decimal number system, the
successive positions to the left of the decimal point represent
units, tens, hundreds, thousands and so on.
 Each position represents a specific power of the base (10). For
example, the decimal number 1234 consists of the digit 4 in the
units position, 3 in the tens position, 2 in the hundreds position,
and 1 in the thousands position, and its value can be written as
 (1x1000)+ (2x100)+ (3x10)+ (4x1)
 (1x103)+ (2x102)+ (3x101)+ (4x100)
COMPUTER FUNDAMENTAL 4
 1000 + 200 + 30 + 4
 1234
Applications of Decimal Number Systems
• We use decimals every day while dealing with money,
weight, length etc.
• Decimal numbers are used in situations where more
precision is required than the whole numbers can
provide.
• For example, when we calculate our weight on the
weighing machine, we do not always find the weight
equal to a whole number on the scale. To know our
exact weight, we must understand what the decimal
value on the scale means.
Binary Number systems
 Characteristics of binary number system are as
follows:
 Uses two digits, 0 and 1.
 Also called base 2 number system
 Each position in a binary number represents a 0 power
of the base (2). Example 20
 Last position in a binary number represents a x power
of the base (2). Example 2x where x represents the
5

last position - 1
Example :-
Binary Number : 101012
Calculating Decimal Equivalent:
Step Binary Number Decimal Number
Step 1 101012=((1 x 24)+(0 x 23)+(1 x 22)+(0 x 21)+(1 x 20))10
Step 2 101012 = (16 + 0 + 4 + 0 + 1)10
Step 3 101012 = 2110

Note : 101012 is normally written as 10101.

6
Applications of Binary Number System

• The binary number system is very useful


in computer technology and computer
programming languages also uses binary
number system that is helpful in digital
encoding.
• The binary number system can also be
used in Boolean algebra.
Advantages and Disadvantages
• The main advantage of using binary is that it is
a base which is easily represented by electronic
devices.
• The Binary Number System are also ease of use
in coding, fewer computations & less
computational errors.
• The major disadvantage of binary number is
difficult to read and write for humans because of
large number of binary of a equivalent decimal
number.
Octal number systems
 Characteristics of Octal number system are
as follows:
 Uses eight digits, 0,1,2,3,4,5,6,7.
 Also called base 8 number system
 Each position in an octal number represents a 0 power
of the base (8). Example 80
 Last position in an octal number represents a x power
of the base (8). Example 8x where x represents the
7

last position - 1.
Example :-
Octal Number : 125708
Calculating Decimal Equivalent:
Step Octal Number Decimal Number
Step 1 125708 =((1 x 84)+(2 x 83)+(5 x 82)+(7 x 81)+(0 x 80))10
Step 2 125708 =(4096 + 1024 + 320 + 56 + 0)10
Step 3 125708 =549610

Note : 125708 is normally written as 12570.

8
Applications of Octal Number System
• The octal numbers are not as common as
they used to be.
• Octal is used when the number of bits in
one word is a multiple of 3.
• It is also used as a shorthand for
representing file permissions on UNIX
systems and representation of UTF8
numbers, etc.
Advantages and Disadvantages
• The main advantage of using Octal numbers is that it
uses less digits than decimal and Hexadecimal number
system. So, it has fewer computations and less
computational errors.
• It uses only 3 bits to represent any digit in binary and
easy to convert from octal to binary and vice-versa. It
is easier to handle input and output in the octal form.
• Disadvantage of Octal number system is that computer
does not understand octal number system directly, so
we need octal to binary converter.
Hexadecimal Number
system
 Characteristics of Hexadecimal number system are
as follows:
 Uses 10 digits and 6 letters, 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
 Letters represents numbers starting from 10. A = 10. B = 11, C =
12, D = 13, E = 14, F = 15.
 Also called base 16 number system
 Each position in a hexadecimal number represents a 0 power of
the base (16). Example 160

COMPL
UTEa
R Fs
UNt pENoTALsition
DAM in a hexadecimal number represents a x power of
9

the base (16). Example 16x where x represents the last position -
Example :-
Hexadecimal Number : 19FDE16
Calculating Decimal Equivalent:
Step Binary Number Decimal Number
Step 1 19FDE16 =((1 x 164)+(9 x 163)+(F x 162)+(D x 161)+(E x 160))10
Step 2 19FDE16= ((1 x 164)+(9 x 163)+(15 x 162)+(13x 161)+(14x 160))10
Step 3 19FDE16 =(65536+ 36864 + 3840 + 208 + 14)10
Step 4 19FDE16 =10646210

10
Advantages and Disadvantages
• It uses less memory to store more numbers, for example it store
256 numbers in two digits whereas decimal number stores 100
numbers in two digits.
• This number system is also used to represent Computer memory
addresses. It uses only 4 bits to represent any digit in binary and
easy to convert from hexadecimal to binary and vice-versa.
• It is easier to handle input and output in the hexadecimal form.
There is wide number of advantages in data science field,
artificial intelligence and machine learning.
• Disadvantage: It may not an easy to read and write for people,
and also difficult to perform operations like multiplications,
divisions using hexadecimal number system. Hexadecimal
numbers is most difficult number system for dealing with
Computer’s data.
Applications of Hexadecimal Number System

• Hexadecimal Number System is commonly used in


Computer programming and Microprocessors.
• It is also helpful to describe colors on web pages. Each
of the three primary colors (i.e., red, green and blue)
is represented by two hexadecimal digits to create 255
possible values, thus resulting in more than 16 million
possible colors.
• Hexadecimal number system is used to describe
locations in memory for every byte.
• These hexadecimal numbers are also easier to read
and write than binary or decimal numbers for
Computer Professionals.
Number Conversions

11
Decimal to Other Base
System
 Step 1 - Divide the decimal number to be converted by the value
of the new base.
 Step 2 - Get the remainder from Step 1 as the rightmost digit
(least significant digit) of new base number.
 Step 3 - Divide the quotient of the previous divide by the new
base.
 Step 4 - Record the remainder from Step 3 as the next digit (to
the left) of the new base number.
 Repeat Steps 3 and 4, getting remainders from right to left, until
the quotient becomes zero in Step 3.
 The last remainder thus obtained will be the most significant digit
COMPUTER FUNDAMENTAL 12

(MSD) of the new base number.


Example :-
Decimal Number : 2910
Calculating Binary Equivalent:
Step Operation Result Remainder
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7/2 3 1
Step 4 3/2 1 1
Step 5 1/2 0 1
As mentioned in Steps 2 and 4, the remainders have to be arranged
in the reverse order so that the first remainder becomes the least
significant digit (LSD) and the last remainder becomes the most
significant digit (MSD).
Decimal Number : 2910 = Binary Number : 111012.
COMPUTER FUNDAMENTAL 13
Decimal to Octal
• Take decimal number as dividend.
• Divide this number by 8 (8 is base of octal so
divisor here).
• Store the remainder in an array (it will be: 0, 1,
2, 3, 4, 5, 6 or 7 because of divisor 8).
• Repeat the above two steps until the number is
greater than zero.
• Print the array in reverse order (which will be
equivalent octal number of given decimal
number).
Example
Decimal to Hexadecimal
• Take decimal number as dividend.
• Divide this number by 16 (16 is base of hexadecimal
so divisor here).
• Store the remainder in an array (it will be: 0 to 15
because of divisor 16, replace 10, 11, 12, 13, 14, 15
by A, B, C, D, E, F respectively).
• Repeat the above two steps until the number is
greater than zero.
• Print the array in reverse order (which will be
equivalent hexadecimal number of given decimal
number).
Example
Shortcut method - Binary to Octal
Steps
 Step 1 - Divide the binary digits into groups
 of three (starting from the right).
 Step 2 - Convert each group of three binary
 digits to one octal digit.
Example:
Binary Number : 101012
Calculating Octal Equivalent:
Step Binary Number Octal Number

Step 1 101012 010 101

Step 2 101012 28 58

Step 3 101012 258

Binary Number : 101012 = Octal Number : 258


Shortcut method - Octal to Binary
• Step 1 - Convert each octal digit to a 3 digit binary number (the octal digits may be treated as
2 decimal for this conversion).

 Step 2 - Combine all the resulting binary groups (of 3 digits each) into a single
binary number.

 Example:
Octal Number : 58
Calculating Binary Equivalent:
Step Octal Number Binary Number

Step 1 258 210 510

Step 2 258 0102 1012

Step 3 258 0101012

Octal Number : 258 = Binary Number : 101012


Shortcut method - Binary to Hexadecimal
• Step 1 - Divide the binary digits into groups of four (starting from the right).

 Step 2 - Convert each group of four binary digits to one hexadecimal symbol.

 Example

Binary Number : 101012


Calculating hexadecimal Equivalent:
Step Binary Number Hexadecimal Number

Step 1 101012 0001 0101

Step 2 101012 110 510

Step 3 101012 1516

Binary Number : 101012 = Hexadecimal Number : 1516


Shortcut method - Hexadecimal to Binary

steps
•Step 1 - Convert each hexadecimal
digit to a 4 digit binary number (the
hexadecimal digits may be treated
as decimal for this conversion).
•Step 2 - Combine all the resulting
binary groups (of 4 digits each) into
a single binary number.
Example
Hexadecimal Number : 1516
Calculating Binary Equivalent:
Step Hexadecimal Number Binary Number

Step 1 1516 110 510

Step 2 1516 00012 01012

Step 3 1516 000101012

Hexadecimal Number : 1516 = Binary Number: 101012


DIGITAL LOGIC AND COMPUTER ARCHITECTURE (20ITC05)

FACULTY: E RAMALAKSHMI
Digital Logic &
Computer Architecture
 Digital Electronics is a branch of Electronics
which deals with Digital systems and signals.
 Digital system is a device or machine
which deals with 0’s and 1’s.
 Any device that uses digital information
uses digital electronics
 The work with digital domain is efficient than
analog domain.
 All real life signals are analog.
 How we can process it by using digital
system?
 We have two analog interface.
 First one is the input interface.
 Second one is the output interface.
 There will be a transducer and an anti-
transducer .
 There is also a digital system.
Analog to Digital convertor

Digital to Analog convertor


A
A
n
n
a
a
l
l
o
o
g
g Digital
Multi-Bit System Multi-Bit
O
I
u
n
t
p
p
u
u
t
t
 Lets have an analog signal converted into
digital signal.
 Transducer send multi-bit stream to the
digital system.
 Digital system can b a computer calculator or
any measuring instrument.
 The signal is again converted back to the
analog and you have output.
 We will learn about the digital system.
 Digital system is made of sub-systems.
 These sub-systems are made of Modules.
 Modules are made of basic units.
 We can take basic units as logic gates.
Digital System

Sub Systems

Modules

Basic Units(Logic gates)


 We have to learn the basic units i.e. logic
gates.
 these gates have some input.
 They are made of circuits resister, capacitor,
transistor...
 According to their arrangement a specific
logic is set.
Digital Computers
• Digital – A limited number of discrete value
• Bit – A Binary Digit Application S/W
• Program – A Sequence of instructions

• Computer = H/W + S/W


• Program(S/W) API
• A sequence of instruction
Operating System
• S/W = Program + Data
• The data that are manipulated by the
program constitute the data base
• Application S/W ROM BIOS
• DB, word processor, Spread Sheet,
game Computer H/W
• System S/W
• OS, Firmware, Compiler, Device Driver
Block Diagram of Digital Computer
Computer Hardware

• CPU
• Memory
• Program Memory(ROM)
• Data Memory(RAM)
• I/O Device
• Input Device: Keyboard, Mouse, Scanner
• Output Device: Printer, Plotter, Display
• Storage Device(I/O): FDD, HDD, MOD
Computer Organization

• Is concerned with the way the hardware


components operate and the way they are
connected together to form computer system

• The components are assumed to be in place


and the task is to investigate the
organizational structure to verify that the
computer parts operate as intended
Computer Design

• Is concerned with hardware design of


computer

•Once computer specifications are formulated,


it is the task of designer to develop hardware
for the system

•Computer design is concerned with the


determination of what hardware should be
used & how that parts should be connected
Computer Architecture

• Is concerned with the structure and behavior


of computer as seen by user

•It includes information, formats, the


instruction set and techniques for addressing
memory
Types of Computer Architectures

Two Types of Computer Architectures

• Von Neumann Architecture


• Harvard Architecture
Von Neumann Architecture

• Describes a general frame work that a


computer’s hardware, programming and data
should follow
• Most of the computers used today operate
according to Von Neumann Architecture
• Von Neumann visualized the structure of a
computer system as being composed of
following components
Von Neumann Architecture

1. The central arithmetic Unit(ALU): performs


the computer’s computational and logical
functions
2. Memory: specifically computer’s main
memory or fast memory such as RAM
3. Control Unit(CU): directs other components
of the computer to perform certain actions
4. Man- machine Interfaces: I/p and O/p
devices such as keyboard for i/p, display
monitor for o/p
Principle of working Von Neumann
Architecture
1. Instructions and Data are stored in the
same read/write memory
2. Instructions are executed sequentially one
at a time
3. All the Instructions/data are accessed by
CPU from memory using address locations
Harvard Architecture

• Uses physically separate storage and signal


path ways for their Instructions and Data
• In a computer with Harvard Architecture,
CPU can read both data and Instructions from
memory at the same time
•Double the memory band width
Ex: digital signal processor based computer
system
Logic Gates
Objectives
• Identify the basic gates and describe the
behavior of each
• Combine basic gates into circuits
• Describe the behavior of a gate or circuit using
truth tables, and logic diagrams
• Binary information is represented in digital
computers by signals, Electrical signals such as
voltages exist throughout the computer in
either one of two recognizable states
• The two states represent a binary variable that
can be equal to 1 or O.
• For example, a particular digital computer may
employ a signal of 3 volts to represent binary
1. and 0.5 volt to represent binary O.
• Binary logic deals with binary variables and
with operations that assume a logical
meaning.
• The manipulation of binary information is
done by logic circuits called gates.
• Gates are blocks of hardware that produce
signals of binary 1 or 0 when input logic
requirements are satisfied.
What are Logic Gates?
• Gates are basic building blocks of a digital circuit
Logic Gate
– Is a physical device which performs logic operation on
one or more logical inputs, and produces a single logical
output
– Ex: inversion, multiplication, sum etc.
Circuits
– Gates combined to perform more complicated tasks
• Output depends on the logic gate and the input
• Input is one of two states – high or low
• Output is one of two states – high or low
How do we describe the behavior of
gates and circuits?
Boolean expressions
Uses Boolean algebra, a mathematical notation
for expressing two-valued logic
Logic diagrams
A graphical representation of a circuit; each gate
has its own symbol
Truth tables
A table showing all possible input value and the
associated output values

6
• A variety of logic gates are commonly used in
digital computer systems.
• Each gate has a distinct graphic symbol and its
operation can be described by means of an
algebraic expression.
• The input-output relationship of the binary
variables for each gate can be represented in
tabular form by a truth table.
NOT Gate

• A NOT gate accepts one input signal (0 or 1) and


returns the opposite signal as output

Various representations of a NOT gate


8
AND Gate
• An AND gate accepts two input signals
• If both inputs are 1, the output is 1; otherwise, the
output is 0

Various representations of an AND gate

9
OR Gate
• An OR gate accepts two input signals
• If both inputs are 0, the output is 0; otherwise, the
output is 1

Various representations of a OR gate


10
XOR Gate
• An XOR gate accepts two input signals
• If both inputs are the same the output is 0;
otherwise the output is 1

Various representations of an XOR gate

11
XOR Gate
• Note the difference between the XOR gate
and the OR gate; they differ only in one
input situation
• When both input signals are 1, the OR gate
produces a 1 and the XOR produces a 0
• XOR is called the exclusive OR

12
NAND Gate
• The NAND gate accepts two input signals
• If both inputs are 1, the output is 0; otherwise, the
output is 1

Various representations of a NAND gate


NOR Gate
The NOR gate accepts two input signals
If both are 0, the output is 1; otherwise,
the output is 0

Figure 4.6 Various representations of a NOR gate

14
Review of Gate Processing
A NOT gate inverts its single input
An AND gate produces 1 if both input values are 1
An OR gate produces 0 if both input values are 0
An XOR gate produces 0 if input values are the same
A NAND gate produces 0 if both inputs are 1
A NOR gate produces a 1 if both inputs are 0

15
Gates with More Inputs
• Gates can be designed to accept three or more input values
• A three-input AND gate, for example, produces an output of 1
only if all input values are 1

Various representations of a three-input AND gate


16
Constructing Gates
Transistor
• A device that acts either as a wire that conducts
electricity or as a resistor that blocks the flow of
electricity, depending on the voltage level of an input
signal
• A transistor has no moving parts, yet acts like
a switch
• It is made of a semiconductor material, which is
neither a particularly good conductor of electricity
nor a particularly good insulator

17
Logic Gates
Logic Gates
Classification
• Basic Gates
• Universal gates
• Arithmetic Gates
Circuits
• Gates are combined into circuits by using the output
of one gate as the input for another

21
Combinational Circuits

22
Combinational Circuits

• Three inputs require eight rows to describe all possible input


combinations

24
Circuit equivalence
• Two circuits that produce the same output for
identical input

25
Boolean Algebra
Boolean Algebra

George Boole, the mathematician, developed


boolean algebra to simplify the handling of
complex connectives.
Boolean Algebra uses ordinary algebraic
notation, and 1 for True and 0 for False.
Boolean Algebra

• Boolean algebra is an algebra that deals with


binary variables and logic operations.
• The variables are designated by letters such as A,
B, x, and y.
• The three basic logic operations are AND, OR,
and complement.
• Boolean function can be expressed algebraically
with binary variables, the logic operation,
symbols, parentheses, and equal sign.
• For a given value of the variables, the Boolean
function can be either 1 or 0.
Example for Boolean function

F= x +y1z
• The function F is equal to 1 if x is 1 or if
both y' and z are equal to 1
• F is equal to 0 otherwise
• y' = 1 is equivalent to saying that y = 0
• => F is equal to 1, if x or if yz = 01,
Example for Boolean function

•The relationship between a function and its


binary variables can be represented in a truth
table.
• To represent a function in a truth table we need
a list of the 2n combinations of the n binary
variables.
• There are eight possible distinct combinations
for assigning bits to the three variables x, y, z.
• The function F is equal to 1 for those
combinations where x = 1 or yz = 01, it is equal
to 0 for all other combinations
Truth Table

F= x +y1z
• A Boolean function can be transformed from
an algebraic expression into a logic diagram
composed of AND, OR, and inverter gates
F= x +y1z
Boolean Algebra

I will take an umbrella with me if it is raining


or the weather forecast is bad
Boolean Algebra

I will take an umbrella with me if it is raining


or the weather forecast is bad
Boolean Algebra

I will take an umbrella with me if it is raining


or the weather forecast is bad

A Simple Proposition
Boolean Algebra

I will take an umbrella with me if it is raining


or the weather forecast is bad

Propositions may be TRUE or FALSE, are functions of other


propositions, and connected by logical connections (AND, OR,
NOT)
Boolean Algebra

I will take an umbrella with me if it is raining


or the weather forecast is bad

Truth Table
Boolean Algebra

I will take an umbrella with me if it is raining


or the weather forecast is bad
Raining Bad Forecast Umbrella
0 0 0
0 1 1
1 0 1
1 1 1

U=R+F

Boolean equation
Boolean Algebra

If I do not take the car then I will take an


umbrella if it is raining or the weather forecast
is bad
Boolean Algebra

If I do not take the car then I will take an


umbrella if it is raining or the weather forecast
is bad

1
Boolean Algebra

If I do not take the car then I will take an


umbrella if it is raining or the weather forecast
is bad

1
Boolean Algebra

If I do not take the car then I will take an


umbrella if it is raining or the weather forecast
is bad

U = C’. (W + R)
1
Boolean Algebra

If I do not take the car then I will take an


umbrella if it is raining or the weather forecast
is bad

U = C’. (W + R)
1
purpose of Boolean algebra

• To facilitate the analysis and design of digital


circuits
• It provides a convenient tool to:
1. Express in algebraic form a truth table
relationship between binary variables.
2. Express in algebraic form the input-output
relationship of logic diagrams.
3. Find simpler circuits for the same function.
• By manipulating a Boolean expression according
to Boolean algebra rules, one may obtain a
simpler expression that will require fewer gates
• The Boolean algebra has its own set of
fundamental laws which differ from ordinary
algebra
Boolean algebra rules

(18) x+x1y= x+y


Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z

1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)

1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)

F = X Y (Z + Z) + X Y (Identity)
=1

1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)

F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY

1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)

F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY

F = (X + X) Y (Distributive Law)

2
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)

F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY

F = (X + X) Y (Distributive Law)

F = (X + X) Y (Identity)
=1

2
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)

F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY

F = (X + X) Y (Distributive Law)

F = (X + X) Y (Identity)
=1
F =Y
2
Example1

P.T (AB+C)(AB+D)=AB+CD

 AB.AB+AB.D+C.AB+C.D
 AB+ABD+ABC+CD {A.A=A}
 AB(1+D)+ABC+CD {1+A=1}
 AB+ABC+CD
 AB(1+C)+CD
 AB+CD
Example 2

AB' + C1D + AB' + C1D

 AB' + C1D
Example 3

F = ABC + ABC1+A'C

 AB(C + C1) + A'C {(C + C)' = 1} &{AB.1 = AB}


 AB + A'C
Implementation
Implementation
Complement of a function

• The complement of a function F when


expressed in a truth table is obtained by
interchanging 1's and 0's in the values of F in the
truth table.
•When the function is expressed in algebraic
form, the complement of the function can be
derived by means of DeMorgan's theorem.
Complement of a function

• The general form of DeMorgan's theorem can


be expressed as follows
Complement of a function

• From the general DeMorgan's theorem it can


be derive a simple procedure for obtaining the
complement of an algebraic expression.
• This is done by changing all OR operations to
AND operations and all AND operations to OR
operations and then complementing each
individual letter variable
Example

F = AB + C'D' B1D

F1= (A1+B1)(C+D)(B+D1)
Two Graphic Symbols for NOR gate
Two Graphic Symbols for NAND gate
Universal Gates

• NAND and NOR Gates can be used to


implement any boolean function, including AND
,OR and NOT.
•Hence NAND and NOR gates are called as
Universal Gates
Truth Table to verify DeMorgan’s Laws

X + Y =X·Y X · Y = X + Y
X Y X·Y X+Y X Y X+Y X · Y X·Y X+Y
0 0 0 0 1 1 1 1 1 1
0 1 0 1 1 0 0 0 1 1
1 0 0 1 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0 0
• Generalized DeMorgan’s Theorem:
X1 + X2 + … + Xn = X1 · X2 · … · Xn
X1 · X2 · … · Xn = X1 + X2 + … + Xn
Sum of product (SOP) Form
&
Product of sum (POS) Form
F= x +y1z
• The sum-of-products (SOP) form is a method
or form of simplifying the Boolean
expressions of logic gates.
• Sum and product derived from the symbolic
representations of the OR and AND functions.
• OR (+) , AND ( . ) , addition and multiplication.
Sum

f(A,B,C) = ABC + A’BC’

Product terms
• When two or more sum terms are multiplied
by a Boolean OR operation.
• Sum terms are defined by using OR operation
and the product term is defined by using AND
operation.
Product

f(A,B,C) = (A’+B) . (B+C’)

Sum terms
• The canonical forms are the special cases of
SOP and POS forms.
• These are also known as standard SOP and
POS forms.
• In SOP or POS form, all individual terms do not
involve all literals.
• For example AB + A’BC the first product term
do not contain literal C.
• If each term in SOP or POS contain all literals
then the expression is known as standard or
canonical form.
• Each individual term in the POS form is called Maxterm.
• Each individual term in the SOP form is called Minterm.
• In Minterm, we look for the functions where the output
results is “1”.
• while in Maxterm we look for function where the output
results is “0”.
• We perform Sum of minterm also known as Sum of products
(SOP) .
• We perform Product of Maxterm also known as Product of
sum (POS).
 Step 1: Find the missing literal in each product
term if any.
 Step 2: And each product term having missing
literals with terms form by ORing the literal and
its complement.
Step 3: Expand the term by applying,
distributive law and reorder the literals.
Step 4: Reduce the repeated product terms.
Because A + A = A
f (A,B,C) = AB + BC + AC
Step 1: Find the missing literals in each product
term.
f (A,B,C) = AB + BC + AC
Literal B is missing

Literal A is missing

Literal C is missing
Step 2: AND the product term with missing literal + its
complement.
f (A,B,C) = AB . (C+C’) + BC . (A+A’) + AC . (B+B’)

Missing literals and their complements


Step 3: Expands the term and reorder the literals.
f (A,B,C) = AB . (C+C’) + BC . (A+A’) + AC . (B+B’)
Expand & Reorder:
ABC + ABC’ + ABC + A’BC + ABC + AB’C
Step 4: Omit repeated product terms.

f(A,B,C)=ABC + ABC’ + ABC + A’BC + ABC + AB’C


f(A,B,C)= ABC + ABC’ + A’BC + AB’C
 Step 1: Find the missing literal in each sum
term if any.
 Step 2: OR each sum term having missing
literals with terms form by ANDing the literal
and its complement.
Step 3: Expands the term by applying,
distributive law and reorder the literals.
Step 4: Reduce the repeated product terms.
Because A + A = A
Example:
f (A,B,C) = (A + B) . (B + C) . (A + C)

f (A,B,C) = (A + B) . (B + C) . (A + C)
Literal B is missing
Literal A is missing
Literal C is missing

Step 2: OR the sum term with missing literal . its


complement.
f (A,B,C) = (A + B)+(C.C’) + (B + C)+(A.A’) + (A + C)+(B.B’)

Missing literals and their complements


f (A,B,C) = (A + B)+(C.C’) + (B + C)+(A.A’) + (A +C)+(B.B’)
Expand & Reorder:
f(A,B,C)=(A+B+C).(A+B+C’).(A+B+C).(A’+B+C).(A+B+C).(A+B’+C)
Step 4: Omit repeated sum terms.

f(A,B,C)=(A+B+C).(A+B+C’).(A+B+C).(A’+B+C).(A+B+C).(A+B’+C)
f(A,B,C)=(A+B+C).(A+B+C’).(A’+B+C).(A+B’+C)
• Minterms are AND terms with every variable present in
either true or complemented form.
• Given that each binary variable may appear normal
(e.g., x) or complemented (e.g.x’ ), there are 2n m
• Example: Two variables (X and Y)produce 2 x 2 = 4
combinations:
XY(both normal)
XY’(X normal, Y complemented)
X’Y(X complemented, Y normal)
X’Y’(both complemented)
Thus there are four minterms of two variables.
• Maxterms are OR terms with every variable in true or
complemented form.
• Given that each binary variable may appear normal
(e.g., x) or complemented (e.g. x’), there are 2n
maxterms for n variables.
• Example: Two variables (X and Y) produce 2x2=4
combinations:
X+Y(both normal)
X+Y’(x normal, y complemented)
X’+Y(x complemented, y normal)
X’+Y’(both complemented)
A B C Minterms Maxterms

0 0 0 A’B’C’ = m0 A+B+C = M0

0 0 1 A’B’C = m1 A+B+C’ = M1

0 1 0 A’BC’ = m2 A+B’+C = M2

0 1 1 A’BC = m3 A+B’+C’ = M3

1 0 0 AB’C’ = m4 A’+B+C = M4

1 0 1 AB’C = m5 A’+B+C’ = M5

1 1 0 ABC’ = m6 A’+B’+C = M6

1 1 1 ABC = m7 A’+B’+C’ = M7
Minterms:
1. f(A,B,C) = A’B’C’ + A’BC’ + A’BC + ABC
= m0 + m2 + m3 + m7
= Σm(0,2,3,7)
2. f(A,B,C)= A’B’C + A’BC + AB’C + ABC
= m1 + m3 + m5 + m7
= Σm(1,3,5,7)
3. f(A,B,C)= A’B’C’ + A’BC’ + A’BC + ABC’
= m0 + m2 + m3 + m6
= Σm(0,2,3,6)
1. f(A,B,C) = (A+B+C).(A+B’+C).(A+B’+C’).(A’+B’+C’)
= M0 + M2 + M3 + M7
= ΠM(0,2,3,7)
2. f(A,B,C)= (A+B+C’).(A+B’+C’).(A+B’+C’).(A’+B’+C’)
= M1 + M3 + M5 + M7
= ΠM (1,3,5,7)
3. f(A,B,C)= (A+B+C).(A+B’+C).(A+B’+C’).(A’+B’+C)
= M0 + M2 + M3 + M6
= ΠM (0,2,3,6)
Map Simplification
Karnaugh map
• The Karnaugh map, also known as the K-map, is an alternative
method to simplify boolean algebra expressions.

• Instead of using Boolean algebra simplification techniques, you


can transfer logic values from a Boolean statement or a truth
table into a Karnaugh map

• The required boolean results are transferred from a truth table


onto a two- dimensional grid where the cells are ordered in
Gray code, and each cell position represents one combination
of input conditions, while each cell value represents the
corresponding output value. Optimal groups of 1s or 0s are
identified.
• The arrangement of 0's and 1's within the map helps you to
visualize the logic relationships between the variables and
leads directly to a simplified Boolean statement

• These terms can be used to write a minimal boolean


expression representing the required logic

• Karnaugh maps, or K-maps, are often used to simplify logic


problems with 2, 3 or 4 variables.

Cell = 2n ,where n is a number of variables


Two- Variable Map
Three- Variable Map
Four- Variable Map
Karnaugh maps

• The Karnaugh map is completed by entering a '1‘(or


‘0’) in each of the appropriate cells

• Within the map, adjacent cells containing 1's (or 0’s)


are grouped together in twos, fours, or eights.
Karnaugh Maps - Rules of Simplification
The Karnaugh map uses the following rules for the simplification of
expressions by grouping together adjacent cells containing ones.

1.Groups may not include any cell containing a zero.

2.Groups may be horizontal or vertical, but not


diagonal.
3. Groups must contain 1, 2, 4, 8, or in general 2ncells.
That is if n = 1, a group will contain two 1's since 21 = 2.
If n = 2, a group will contain four 1's since 22 = 4.
4. Each group should be as large as possible.

5.Each cell containing a one must be in at least one group.


6.Groups may overlap.
7.Groups may wrap around the table.
The leftmost cell in a row may be grouped with the rightmost
cell and the top cell in a column may be grouped with the
bottom cell.
8. There should be as few groups as possible, as long as
this does not contradict any of the previous rules.
Summmary:

 N o zeros allowed.
 N o diagonals.
 O n l y power of 2 number of cells in eachgroup.
 Groups should be as large as possible.
 Eve r y one must be in at least onegroup.
 Overlapping allowed.
 Wr a p aroundallowed.
 Fewest number of groups possible.
Examples
Example 1

2-variable Karnaugh maps are trivial but can be used to introduce


the methods you need to learn. The map for a 2-input OR gate
looks like this:
A
0 1
B
A
Y 0 1
B
A
1 1 1
A B Y
0 0 0
B
0 1 1
1 0 1
A+B
1 1 1
Example 2

AC
A B C Y
0 0 0 1 AB
C 00 01 11 10
0 0 1 1
0 1 0 0 0 1 1 1
0 1 1 0
1 0 0 1 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0 B
B  AC
Exercise

 F(A,B,C) = ∑(3,4,6,7)

Solution
Exercise

 F(A, B, C) = ∑(0, 2, 4, 5, 6)
Solution
Exercise

 F(A, B, C, D) = ∑(0, 1, 2, 6, 8, 9, 10)


Solution
K Map:
Product of Sums simplification
Product of Sums simplification

• In sum-of-products form the product terms are AND terms and


the sum denotes the ORing of these terms.
• It is sometimes convenient to obtain the algebraic expression
for the function in a product-of-sums form
• The sums are OR terms and the product denotes the ANDing
of these terms.
Product of Sums simplification: Procedure

• The 1's in the map represent the minterms that produce 1 for
the function.
• The squares not marked by 1 represent the minterms that
produce 0 for the function.
• mark the empty squares with O's and combine them into
groups of adjacent squares and obtain the complement of the
function, F'
• Taking the complement of F' produces an expression for F in
product-of-sums form.
Examples
Exercise

 F(A, B, C,D) = ∑(0, 1, 2, 5, 8, 9, 10) using POS


Solution: POS form

F = (A' + B')(C + D')(B' + D)


Solution: SOP form
Logic diagrams with AND and OR gates.
Logic diagrams with NAND or NOR gates.
Don't'Care Conditions

• The 1's and O's in the map represent the minterms that make
the function equal to 1 or 0.
• There are occasions when it does not matter if the function
produces 0 or 1 for a given minterm.
• Since the function may be either 0 or 1, we say that we don't
care what the function output is to be for this minterm.
• Minterms that may produce either 0 or 1 for the function are
said to be don't-care conditions and are marked with an x in
the map.
• These don't-care conditions can be used to provide further
simplification of the algebraic expression.
Don't'Care Conditions

• When choosing adjacent squares for the function in the map,


the x 's may be assumed to be either 0 or 1, whichever gives
the simplest expression.
• x need not be used at all if it does not contribute to the
simplification of the function.
• In each case, the choice depends only on the simplification
that can be achieved.
• The minterms listed with F produce a 1 for the function.
• The don't-care minterms listed with d may produce either a 0
or a 1 for the function.
• The remaining minterms produce a 0 for the function
Don't'Care Conditions

• F(A, B, C) = ∑(0, 2, 6)
d(A,B,C) = ∑(1,3,5)
Solution

Which represents the Boolean function F(A, B,C) = ∑(0,1, 2, 3, 6)


Don't'Care Conditions

• If don't-care minterms 1 and 3 were not included with the 1's


F = A'C‘ + BC‘

You might also like

pFad - Phonifier reborn

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

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


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy