Comparators A comparator compares two input words.

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

Registers Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens A clock is a free-running signal with a cycle time. A clock may.
Chapter 7 Henry Hexmoor Registers and RTL
Sequential Logic ENEL 111. Sequential Logic Circuits So far we have only considered circuits where the output is purely a function of the inputs With.
COE 202: Digital Logic Design Sequential Circuits Part 1 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
Flip-Flops Computer Organization I 1 June 2010 © McQuain, Feng & Ribbens A clock is a free-running signal with a cycle time. A clock may be.
ECE 331 – Digital System Design Latches and Flip-Flops (Lecture #17) The slides included herein were taken from the materials accompanying Fundamentals.
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Module 12.  In Module 9, 10, 11, you have been introduced to examples of combinational logic circuits whereby the outputs are entirely dependent on the.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits – I Flip-Flops A sequential circuit is a logic components whose outputs.
LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
The Logic Machine We looked at programming at the high level and at the low level. The question now is: How can a physical computer be built to run a program?
Chapter 4 Gates and Circuits.
Logic and Computer Design Fundamentals Registers and Counters
Chapter 3 Continued Logic Gates Logic Chips Combinational Logic Timing Sequential Logic Flip Flops Registers Memory State Machines.
Comparators  A comparator compares two input words.  The following slide shows a simple comparator which takes two inputs, A, and B, each of length 4.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Digital Logic Level.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
A presentation on Counters
Digital Logic Design CHAPTER 5 Sequential Logic. 2 Sequential Circuits Combinational circuits – The outputs are entirely dependent on the current inputs.
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Chapter 3: Boolean Algebra
Chapter 4 Gates and Circuits.
COE 202: Digital Logic Design Sequential Circuits Part 1
Flip Flop
1 Registers and Counters A register consists of a group of flip-flops and gates that affect their transition. An n-bit register consists of n-bit flip-flops.
Rabie A. Ramadan Lecture 3
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
P. 4.1 Digital Technology and Computer Fundamentals Chapter 4 Digital Components.
The Digital Logic Level
1 DIGITAL ELECTRONICS. 2 OVERVIEW –electronic circuits capable of carrying out logical (boolean) and arithmetic operations on information stored as binary.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
Basic Sequential Components CT101 – Computing Systems Organization.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
CHAPTER-2 Fundamentals of Digital Logic. Digital Logic Digital electronic circuits are used to build computer hardware as well as other products (digital.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Sequential Logic Computer Organization II 1 © McQuain A clock is a free-running signal with a cycle time. A clock may be either high or.
COUNTERS Why do we need counters?
Counters.
1 Fundamentals of Computer Science Combinational Circuits.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
Sequential Logic Flip-Flop Circuits By Dylan Smeder.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
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.
COMBINATIONAL AND SEQUENTIAL CIRCUITS Guided By: Prof. P. B. Swadas Prepared By: BIRLA VISHVAKARMA MAHAVDYALAYA.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
1 CE 454 Computer Architecture Lecture 5 Ahmed Ezzat The Digital Logic, Ch-3.1, 3.2.
Sequential Logic Design
Computer Science 210 Computer Organization
FLIP FLOPS Binary unit capable of storing one bit – 0 or 1
Clocks A clock is a free-running signal with a cycle time.
Computer Science 210 Computer Organization
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
LECTURE 15 – DIGITAL ELECTRONICS
Fundamentals of Computer Science Part i2
Computer Science 210 Computer Organization
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Registers and Counters
Digital Circuits and Logic
Presentation transcript:

Comparators A comparator compares two input words. The following slide shows a simple comparator which takes two inputs, A, and B, each of length 4 bits, and produces 1 if they are equal and a 0 if they are not equal. The circuit is based on the XOR gate (EXCLUSIVE OR) gate, which puts out a 0 if its inputs are equal and a 1 if they are unequal. If the two words are equal, all four of the XOR gates must output 0. The results are then combined with a NOR gate.

Comparators

Programmable Logic Arrays Arbitrary functions (truth tables) can be constructed by computing product terms with AND gates and then ORing the products together. A very general chip for forming the sums of products is the Programmable Logic Array or PLA. An example is shown on the following slide. The user programs this array by burning out selected fuses (there are 1200 total fuses). The fuses burned determine which signals go to each AND gate.

Programmable Logic Arrays

Programmable Logic Arrays The output consists of six OR gates, each of which has up to 50 inputs, corresponding to the 50 outputs of the AND gates. Once again a user supplied (50 x 6) matrix determines which connections actually exist. A PLA can be used to compute the majority function described previously. Examine the diagram for the circuit. By using just 3 of the 12 PLA inputs, four of its 50 AND gates, and one of its six OR gates, we can implement the circuit. Actually, we could wire the PLA to compute simultaneously a total of four functions of similar complexity.

Programmable Logic Arrays Field-programmable PLAs (shipped from the factories with all fuses intact and then programmed by the user) are still in use, but for many applications custom-made PLAs are preferable. These are designed by the (large-volume) customer and fabricated by the manufacturer to the customer’s specifications. Such PLAs are cheaper than field-programmable ones. We have seen three ways to compute the majority function.

Arithmetic Circuits We now move from general-purpose MSI circuits to MSI combinatorial circuits used for doing arithmetic. The first arithmetic MSI circuit we will examine is an eight-input, eight-output shifter. Eight bits of input are presented on lines D0, … , D7. The output, which is just the input shifted 1 bit is available on lines S0, … , S7. The control line, C, determines the direction of the shift, 0 for left and 1 for right.

Adders

Adders A hardware circuit for performing addition is an essential part of every CPU. The truth table for addition on 1-bit integers is shown on the next slide. Two outputs are present: the sum of the inputs, A and B, and the carry to the next (leftward) position. A circuit for computing both the sum bit and the carry bit is also shown on the next slide. This simple circuit is generally known as a half adder.

Adders

Adders A half adder is adequate for summing the low-order bits of two multiple input words, it will not do for a bit position in the middle of the word because it does not handle the carry into the position from the right. For this, we need the full adder. A full adder is built up from two half adders. Together the two half adders generate both the sum and the carry bits.

Adders

Adders To build an adder for, say, two 16-bit words one just replicates the circuit 16 times. The carry out of a bit is used as the carry into its left neighbor. The carry into the rightmost bit is wired to 0. This type of adder is called a ripple carry adder because in the worst case, adding 1 to 111 … 111 (binary), the addition cannot complete until the carry has rippled all the way from the rightmost bit to the leftmost bit. Adders without this delay are preferred.

Adders Consider giving the adder two upper halves operating in parallel by duplicating the upper half’s hardware. Now instead of a single 32-bit adder, we have three 16-bit adders. Call the upper halves U0 and U1. A 0 is fed into U0 as a carry and a 1 is fed into U1 as a carry. Now both start at the same time as the lower half starts, but only one will be correct. Select the correct one based on the lower half’s output. This is called a carry select adder. And the replication can be repeated.

Arithmetic Logic Units Most computers contain a single circuit for performing the AND, OR, and sum of two machine words. Typically, such a circuit for n-bit words is built up of n identical circuits for the individual bit positions and is called an Arithmetic Logic Unit or ALU. An ALU capable of computing A AND B, A OR B, B, B’, or A + B, depending on the function select lines F0 and F1 is shown on the following slide.

Arithmetic Logic Units

Arithmetic Logic Units The lower left-hand corner of the ALU contains a 2-bit decoder to generate enable signals for the four operations, based on the control signals F0 and F1. Exactly one of the four enable lines is selected. A or B can be forced to 0 by negating ENA or ENB, respectively. It is also possible to get A’, by setting INVA. Under normal conditions, ENA and ENB are both 1 to enable both inputs and INVA is 0. We will later see uses for INVA, ENA, and ENB.

Arithmetic Logic Units The lower right-hand corner of the ALU contains a full adder for computing the sum of A and B, including handling the carries, because it is likely that several of these circuits will eventually be wired together to perform full-word operations. Circuits like the one shown are actually available and are known as bit slices. They allow the computer designer to build an ALU of any desired width.

Arithmetic Logic Units

Clocks In many digital circuits the order in which events happen is critical. To allow designers to achieve the required timing relations, many digital circuits use clocks to provide synchronization. A clock is a circuit that emits a series of pulses with a precise pulse width and precise interval between consecutive pulses. The time interval between the corresponding edges of two consecutive pulses is known as the clock cycle time.

Clocks Pulse frequencies are commonly between 1 and 500 MHz, corresponding to clock cycles of 1000 nsec to 2 nsec. To achieve high accuracy, the clock frequency is usually controlled by a crystal oscillator. In a computer, many events may occur during a single clock cycle. If these events must occur in a certain order, the clock cycle must be divided into subcycles. A secondary clock signal phase-shifted from the primary may be generated with a delay circuit.

Clocks

Clocks The four time references are: Rising edge of C1 Falling edge of C1 Rising edge of C2 Falling edge of C2 By tying different events to the various edges, the required sequencing can be achieved. If more than four time references are needed, more secondary lines can be tapped from the primary, with different delays.

Memory Memory is an essential component of every computer. We will now see the basic components of a memory system starting at the gate level. To create a 1-bit memory, we need a circuit that remembers previous input values. Such a circuit can be constructed from two NOR gates. Analogous circuits can be built from NAND gates.

Latches The circuit on the previous slide is called an SR latch. It has two inputs, S, for Setting the latch and R, for Resetting it. It also has two outputs, Q and Q’, which are complementary. Unlike a combinatorial circuit, the outputs of the latch are not uniquely determined by the current inputs. Assume that both S and R are 0. Assume that Q = 0. Because Q is fed back into the upper NOR gate, both of its inputs are 0, so its output is 1.

Latches

Latches Now imagine that Q is not 0 but 1, with R and S still 0. The upper gate has inputs of 0 and 1, and an output of 0, which is fed back to the lower gate. A state with both outputs equal to 0 is inconsistent, because it forces both gates to have two 0s as input, which, if true, would produce 1, not 0, as output. Similarly, it is impossible to have both outputs equal to 1. The conclusion: for R = S = 0, the latch has two stable states, which we will refer to as 0 and 1, depending on Q.

Latches The circuit “remembers” whether S or R was last on. Now examine the effect of the inputs on the state of the latch. Suppose that S becomes 1 while Q = 0. The inputs to the upper gate are then 1 and 0, forcing the Q’ output to 0. This change makes both inputs to the lower gate 0, forcing the output to 1. Thus, setting S switches the state from 0 to 1. Setting R to 1 when the latch is in state 0 has no effect. Setting S to 1 when in state Q = 1 has no effect, but setting R drives the latch to state Q = 0. The circuit “remembers” whether S or R was last on.

Latches It is often convenient to prevent the latch from changing state except at certain specified times. The circuit to accomplish this is called a clocked SR latch. The circuit has an additional input, the clock, which is normally 0. With the clock 0, both AND gates output 0, and the latch does not change state. When the clock is 1, the latch becomes sensitive to S and R. The terms enable and strobe mean that clock input is 1.

Latches When both S and R are 1, the circuit becomes nondeterministic. This can be prevented from occurring by altering the circuit. A circuit is constructed with only one input, the input to the second AND gate is the complement of the single input D. When D = 1 and the clock is 1, the latch is driven into state Q = 1. When D = 0 and the clock is 1, it is driven into state Q = 0. This circuit is called a clocked D latch and is a true 1-bit memory.

Latches

Latches

Flip-Flops In many circuits it is necessary to sample the value on a certain line at a particular instance in time and store it. In this variant, called a flip-flop, the state transition does not occur when the clock is 1 but during the clock transition from 0 to 1 or 1 to 0 instead. A flip-flop is edge triggered, whereas a latch is level triggered. A pulse generator, used to implement a flip-flop is shown in the following slide.

Flip-Flops

Flip-Flops At first, it might appear that the output of the AND gate would always be zero, since the AND of the signal with its inverse is zero. The inverter has a small, but nonzero propagation delay through it which makes the circuit work. Note that signal b is both inverted and delayed slightly. Signal c has a negligible delay, thus it is (practically) identical to the signal at a. ANDING b and c results in a short pulse.

Flip-Flops

Flip-Flops The standard symbols for latches and flip-flops are shown in the following slide. CK is the clock. The two latches shown load a state when the clock is 1 or 0, respectively. The two flip-flops change state on the rising edge of the clock transition and the falling edge of the clock transition, respectively.

Flip-Flops