Adders Half-adder  Adds two bits Produces a sum and carry  Problem: Cannot use it to build larger inputs Full-adder  Adds three 1-bit values Like half-adder,

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

Chapter 4 Gates and Circuits.
Gates and Circuits Nell Dale & John Lewis (adaptation by Erin Chambers and Michael Goldwasser)
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Chapter 4 Gates and Circuits.
Functions of Combinational Logic
Logical Design.
Multiplexer / Demultiplexer
Functions and Functional Blocks
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 9 Programmable Configurations Read Only Memory (ROM) – –a fixed array of AND gates.
التصميم المنطقي Second Course
Chapter 1 — Computer Abstractions and Technology — 1 Lecture 7 Carry look ahead adders, Latches, Flip-flops, registers, multiplexors, decoders Digital.
Chapter 4 Gates and Circuits.
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
9/19/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 4 Gates and Circuits.
Digital Fundamentals Floyd Chapter 6 Tenth Edition
Combinational Logic1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
DIGITAL SYSTEMS TCE OTHER COMBINATIONAL LOGIC CIRCUITS DECODERS ENCODERS.
Any logic circuits can be transformed to an implementation where only NAND gates (and inverters) are used. The general approach to finding a NAND-gate.
Logic Gates Combinational Circuits
CS 105 Digital Logic Design
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
3 rd IT PREPARED BY:- Zeel Jani ( ) Maitri Purabiya ( ) Manju Chufal( )
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
Chapter 4 Gates and Circuits.
Combinational Circuits Chapter 3 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 2003.
Combinational Logic Design
Chapter 4 Gates and Circuits.
Combinational and Sequential Logic Circuits.
+ CS 325: CS Hardware and Software Organization and Architecture Combinational Circuits 1.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
CPS120: Introduction to Computer Science
Sneha.  Introduction to MUX and DEMUX Introduction to MUX and DEMUX  Multiplexer Multiplexer  4-to-1 Multiplexer (MUX) 4-to-1 Multiplexer (MUX)  Typical.
MSI Devices M. Mano & C. Kime: Logic and Computer Design Fundamentals (Chapter 5) Dr. Costas Kyriacou and Dr. Konstantinos Tatas ACOE161 - Digital Logic.
Functions of Combinational Logic
1 DIGITAL ELECTRONICS. 2 OVERVIEW –electronic circuits capable of carrying out logical (boolean) and arithmetic operations on information stored as binary.
1 Lecture #7 EGR 277 – Digital Logic Reading Assignment: Chapter 4 in Digital Design, 3 rd Edition by Mano Chapter 4 – Combinational Logic Circuits A)
CHAPTER 4 Combinational Logic
Arithmetic Circuits. Half Adder ABSumCarry
CS 105 DIGITAL LOGIC DESIGN Chapter 4 Combinational Logic 1.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Magnitude Comparator Dr. Ahmed Telba.
1 Fundamentals of Computer Science Combinational Circuits.
Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals.
Digital Design Module 2 Multiplexer and Demultiplexer
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
ACOE161 (Spring2007)MSI Devices1 Revision on MSI Devices M. Mano & C. Kime: Logic and Computer Design Fundamentals (Chapter 5)
Week 1: Introduction and Logic gates IT3002 – Computer Architecture
Combinational Circuits
Multiplexer / Demultiplexer
Multiplexer / Demultiplexer
What is a Multiplexer (MUX)?
FUNCTION OF COMBINATIONAL LOGIC CIRCUIT
NAND-ONLY LOGIC CIRCUITS
Basics Combinational Circuits Sequential Circuits
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Chapter 6 Functions of Combinational Logic
Chapter 4 Gates and Circuits.
Multiplexer / Demultiplexer
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Multiplexers & Demultiplexers
Chapter-4 Combinational Logic
Digital System Design Combinational Logic
Arithmetic Circuits.
Unit IV Adders Subtractors Flip Flops Counters Multiplexes and De multiplexes. Integrated circuits-Op. amp – Characteristics Inverting amplifier - Non-inverting.
Presentation transcript:

Adders Half-adder  Adds two bits Produces a sum and carry  Problem: Cannot use it to build larger inputs Full-adder  Adds three 1-bit values Like half-adder, produces a sum and carry  Allows building N-bit adders Simple technique Connect C out of one adder to C in of the next These are called ripple-carry adders

Adders (cont.)

Binary Parallel Adder A 16-bit ripple-carry adder

BCD Adder In BCD, we have only ten combinations from 0000 to These combinations represent 0 to 9 in binary using 8421 code. When the sum of two digits is less than or equal to 9 then the ordinary 4-bit adder can be used But if the sum of two digits is greater than 9 then a correction factor must be added “ie 6,(0110) to the result.” We need to design a circuit that is capable of doing the correct addition

BCD Adder The cases where the sum of two 4-bit numbers is greater than 9 are in the following table: S4S3S3 S2S2 S1S1 S0S

BCD Adder Whenever S 4 =1 (sums greater than 15) Whenever S 3 =1 and either S 2 or S 1 or both are 1 (sums 10 to 15) The previous table can be expressed as: X = S 4 + S 3 ( S 2 + S 1 ) So, whenever X = 1 we should add a correction of 0110 to the sum.

Inputs:[A]=0101, [B]= 0011, C o =

Inputs:[A]=0111, [B]= 0110, C o =

Half Subtractor It is logic circuit that subtracts one bit from another bit and produces two outputs as Difference (Diff) and Borrow (Br). With A and B as inputs, and Diff and Br as the two outputs. A Diff B Br H/S

Half Subtractor BrABD 00iff A 0 B 0 D iff Br

Full Subtractors It is a combinational circuit that performs the arithmetic subtraction of three input bits. It consists of three inputs and two outputs. Two of the input variables denoted by A and B represents the two significant bits to be subtracted. The third input C represents the borrow taken from the next higher significant position.

Full Subtractor The two outputs are designated as Diff for difference and Br for borrow. A B Diff C Br F\S

Full Subtractor The 1’s and 0’s for the output variables are determined from the subtraction of A-B-C. For A=0, B=0, and C=1, we have to borrow a 1 from the next stage, which makes Br=1 and adds 2 to A. Since 2-0-1=1, Diff = 1. For A=0 and BC=11, we need to borrow again, making Br=1 and A=2. Since 2-1-1=0, Diff = 0. For A=1,B=1 and C=1, we have to borrow 1, making Br=1 and A=3. Since 3-1-1=1 making Diff = 1.

Full Subtractor A B C Br Diff CiCi AiBiAiBi D iff Same as S i in full adder

Full Subtractor A B C Br Diff CiCi AiBiAiBi Br

Adders (cont.) Ripple-carry adders can be slow  Delay proportional to number of bits Carry lookahead adders  Eliminate the delay of ripple-carry adders  Carry-ins are generated independently C 0 = A 0 B 0 C 1 = A 0 B 0 A 1 + A 0 B 0 B 1 + A 1 B 1...  Requires complex circuits  Usually, a combination carry lookahead and ripple-carry techniques are used

Introduction to Combinational Circuits Combinational circuits Output depends only on the current inputs Combinational circuits provide a higher level of abstraction  Help in reducing design complexity  Reduce chip count We look at some useful combinational circuits

Examples of Combinational Circuits a) Decoders b) Encoders c) Multiplexers d) Demultiplexers

Integrated Circuits An integrated circuit is a piece (also called a chip) of silicon on which multiple gates or transistors have been embedded These silicon pieces are mounted on a plastic or ceramic package with pins along the edges that can be soldered onto circuit boards or inserted into appropriate sockets

Integrated Circuits SSI, MSI, LSI: They perform small tasks such as addition of few bits. small memories, small processors VLSI Tasks: - Large memory - Complex microprocessors, CPUs

Multiplexers – (Many to One) Multiplexing means transmitting a large number of information units over a smaller number of channels or lines. A Digital Multiplexer is a combinational circuit that selects binary information from one of many input lines and directs it to a single output line. The selection of a particular input line is controlled by a set of selection lines. Normally, 2^n input lines and n selection lines whose bit combinations determine which input is selected.

Multiplexer (MUX): A MUX is a digital switch that has multiple inputs (sources) and a single output (destination). The select lines determine which input is connected to the output. MUX Types  2-to-1 (1 select line)  4-to-1 (2 select lines)  8-to-1 (3 select lines)  16-to-1 (4 select lines) 22 Multiplexer Block Diagram Select Lines Inputs (sources) Output (destination) 12N2N N MUX

Typical Application of a MUX 23 MP3 Player Docking Station Laptop Sound Card Digital Satellite Digital Cable TV Surround Sound System MUX D0 D1 D2 D3 Y BASelected Source 00MP3 01Laptop 10Satellite 11Cable TV Multiple SourcesSingle DestinationSelector

Medium Scale Integration MUX 4-to-1 MUX 8-to-1 MUX 16-to-1 MUX 24 Inputs Select Enable Output (Y) (and inverted output)

Multiplexers Multiplexer  2 n data inputs  n selection inputs  a single output Selection input determines the input that should be connected to the output 4-data input MUX

Multiplexers - Strobe/Enable Input When we may have to combine a no. of multiplexers and enable only one of the multiplexer. So, Strobe/Enable input is included in multiplexer chips(ICs). It can be “active high” or “active low”. Multiplexer is Enabled when strobe is high and Disabled when strobe is low. When the strobe/enable terminal is in “0” state, the output of all the AND gates become “0” and the final output is also “0”. Under this condition, the multiplexer is said to be disabled. When the strobe input is in “1” state, all the four AND gates are enabled and the circuit functions normally as a multiplexer.

Multiplexers (cont.) 4-data input MUX implementation

Demultiplexer (DEMUX):(One to Many) It is the reverse of multiplexer. A DEMUX is a digital switch with a single input (source) and a multiple outputs (destinations). The select lines determine which output the input is connected to. DEMUX Types  1-to-2 (1 select line)  1-to-4 (2 select lines)  1-to-8 (3 select lines)  1-to-16 (4 select lines) 28 Demultiplexer Block Diagram Select Lines Input (source) Outputs (destinations) 2N2N 1 N DEMUX

Typical Application of a DEMUX 29 Single SourceMultiple DestinationsSelector D0 D1 D2 D3 X DEMUX BASelected Destination 00B/W Laser Printer 01Fax Machine 10Color Inkjet Printer 11Pen Plotter B/W Laser Printer Color Inkjet Printer Pen Plotter Fax Machine

Medium Scale Integration DEMUX 1-to-4 DEMUX1-to-8 DEMUX16-to-1 MUX 30 Select Input (inverted) Outputs (inverted) Note : Most Medium Scale Integrated (MSI) DEMUXs, like the three shown, have outputs that are inverted. This is done because it requires few logic gates to implement DEMUXs with inverted outputs rather than no-inverted outputs.

Demultiplexers S1S0O0O1O2O3 0 0I I I I Function Table

Encoder/Decoder Vocabulary  ENCODER- a digital circuit that produces a binary output code depending on which of its inputs are activated.  DECODER- a digital circuit that converts an input binary code into a single numeric output.

ENCODERS AND DECODERS ONLY ONE INPUT ACTIVATED AT A TIME BINARY CODE OUTPUT BINARY CODE INPUT ONLY ONE OUTPUT ACTIVATED AT A TIME

Decoder A decoder is a logic circuit that accepts a set of inputs that represents a binary number and activates only the output that corresponds to the input number. It has n address lines and 2^n outputs. For a given address, only one of the outputs goes high and remaining outputs remain in low state. It is said to have “active high outputs”. For a given address, only one of the outputs goes low while the remaining outputs remain in high state. It is said to have “active low outputs”.

2 to 4 Decoder Function Table:

3 to 8 Decoder Logic function implementation (Full Adder)

3-to-8 Decoder – Active High Output ENABC00O1O2O3O4O5O6O XXX

3-8 Line Decoder (Active-HIGH)

BCD -to- Decimal Decoders The BCD- to-decimal decoder converts each BCD code into one of Ten Positionable decimal digit indications. It is frequently referred as a 4-line -to- 10 line decoder The method of implementation is that only ten decoding gates are required because the BCD code represents only the ten decimal digits 0 through 9. It has four inputs and 10 outputs. Depending on the BCD input, one of the outputs goes to ‘0’ state while the remaining nine outputs go to ‘1’ state.

40 Logic diagram of BCD - decimal decoder (Active LOW output)

Encoder An encoder is a combinational logic circuit that essentially performs a “reverse” of decoder functions. An encoder accepts an active level on one of its inputs, representing digit, such as a decimal or octal digits, and converts it to a coded output such as BCD or binary. Encoders can also be devised to encode various symbols and alphabetic characters. The process of converting from familiar symbols or numbers to a coded format is called encoding.

42  Most decoders accept an input code and produce a HIGH ( or a LOW) at one and only one output line.  In otherwords, a decoder identifies, recognizes, or detects a particular code. The opposite of this decoding process is called Encoding and is performed by a logic circuit called an Encoder.  An encoder has a number of input lines, only one of which input is activated at a given time and produces an N-bit output code, depending on which input is activated. Encoder

General Encoder Diagram

44 Logic circuit for Octal-to Binary Encoder [8-line- 3-line ]

45 A low at any single input will produce the output binary code corresponding to that input. For instance, a low at A 3 ’ will produce O 2 =0, O 1 =1 and O 0 =1, which is binary code for 3. A o ’ is not connected to the logic gates because the encoder outputs always be normally at 0000 when none of the inputs is LOW Truth table for Octal-to Binary Encoder [8-line- 3-line ]

1-bit Arithmetic and Logic Unit Preliminary ALU design 2’s complement Required 1 is added via C in

1-bit Arithmetic and Logic Unit (cont.) Final design

Arithmetic and Logic Unit (cont.) 16-bit ALU

Arithmetic and Logic Unit (cont ’ d) 4-bit ALU

Introduction to Sequential Circuits Output depends on current as well as past inputs  Depends on the history  Have “ memory ” property Sequential circuit consists of Combinational circuit Feedback circuit  Past input is encoded into a set of state variables Uses feedback (to feed the state variables) Simple feedback Uses flip flops

Introduction (cont.) Main components of a sequential circuit

Clock Signal

Clock Signal (cont.) Clock serves two distinct purposes  Synchronization point Start of a cycle End of a cycle Intermediate point at which the clock signal changes levels  Timing information Clock period, ON, and OFF periods Propagation delay  Time required for the output to react to changes in the inputs

Clock Signal (cont.)

Latches Can remember a bit Level-sensitive (not edge-sensitive) A NOR gate implementation of SR latch

Latches (cont.) SR latch outputs follow inputs In clocked SR latch, outputs respond at specific instances  Uses a clock signal

Latches (cont.) D Latch  Avoids the SR = 11 state

Flip-Flops Edge-sensitive devices  Changes occur either at positive or negative edges Positive edge-triggered D flip-flop

Flip-Flops (cont.) Notation  Not strictly followed in the literature We follow the following notation for latches and flip-flops Low level High level Positive edge Negative edge LatchesFlip-flops

Flip-Flops (cont.)

Example Sequential Circuits (cont.) shift Register chip

Memory Design with D Flip Flops Require separate data in and out lines