LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every.
Logic Gates Flip-Flops Registers Adders
Chapter 4: Combinational Logic
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
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.
Sequential Digital Circuits Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
1 Fundamentals of Computer Science Sequential Circuits.
Fall 2004EE 3563 Digital Systems Design EE 3563 Sequential Logic Design Principles  A sequential logic circuit is one whose outputs depend not only on.
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 Lecture 20 Sequential Circuits: Latches. 2 Overview °Circuits require memory to store intermediate data °Sequential circuits use a periodic signal to.
Circuits require memory to store intermediate data
EKT 124 / 3 DIGITAL ELEKTRONIC 1
Sequential circuit Digital electronics is classified into combinational logic and sequential logic. In combinational circuit outpus depends only on present.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
Chapter 4 Gates and Circuits.
11/16/2004EE 42 fall 2004 lecture 331 Lecture #33: Some example circuits Last lecture: –Edge triggers –Registers This lecture: –Example circuits –shift.
Informationsteknologi Friday, October 19, 2007Computer Architecture I - Class 81 Today’s class Digital Logic.
Computer ArchitectureFall 2008 © August 20 th, Introduction to Computer Architecture Lecture 2 – Digital Logic Design.
Comparators A comparator compares two input words.
Chapter 3: Sequential Logic Circuit EKT 121 / 4 ELEKTRONIK DIGIT 1.
Flip Flops. Clock Signal Sequential logic circuits have memory Output is a function of input and present state Sequential circuits are synchronized by.
Logic Gates Combinational Circuits
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.
Chapter 4 Gates and Circuits.
COE 202: Digital Logic Design Sequential Circuits Part 1
Flip Flop
Dept. of Computer Science Engineering Islamic Azad University of Mashhad 1 DIGITAL LOGIC CIRCUITS Dept. of Computer Science Engineering Islamic Azad University.
Practical Digital Design Considerations Part 1 Last Mod: January 2008 ©Paul R. Godin.
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
Using building blocks to make bigger circuits
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.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
Flip-Flops and Registers
PHY 201 (Blum)1 Transistor Odds and Ends. PHY 201 (Blum)2 RTL NOR.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
מבנה מחשב תרגול 2. 2 Boolean AND Operation Truth Table Equivalent Gate Different notations:
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Universal college of engineering & technology. .By Harsh Patel)
Chapter 10 Flip-Flops and Registers 1. Objectives You should be able to: Explain the internal circuit operation of S-R and gated S-R flip-flops. Explain.
Logic Design / Processor and Control Units Tony Diep.
1 Fundamentals of Computer Science Combinational Circuits.
Synchronous Sequential Logic A digital system has combinational logic as well as sequential logic. The latter includes storage elements. feedback path.
EKT 121 / 4 ELEKTRONIK DIGIT I
Sahar Mosleh PageCalifornia State University San Marcos 1 More on Flip Flop State Table and State Diagram.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
Chapter5: Synchronous Sequential Logic – Part 1
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
WORKING PRINCIPLE OF DIGITAL LOGIC
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.
Copyright © 2001 Stephen A. Edwards All rights reserved Busses  Wires sometimes used as shared communication medium  Think “party-line telephone”  Bus.
Flip-Flop Flip-flops Objectives Upon completion of this chapter, you will be able to :  Construct and analyze the operation of a latch flip-flop made.
FLIP FLOPS Binary unit capable of storing one bit – 0 or 1
Basics of digital systems
An Introduction to Microprocessors
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.
LECTURE 15 – DIGITAL ELECTRONICS
Chapter 4 Gates and Circuits.
Satish Pradhan Dnyanasadhana college, Thane
Fundamentals of Computer Science Part i2
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
FLIP-FLOPS.
Sequential Digital Circuits
An Introduction to Microprocessors
Presentation transcript:

LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1

Numbers in a computer: Mark Neil - Microprocessor Course 2 In the Microprocessor and memory Bits are stored electronically Each bit is represented by an electrical signal which is either a high or low voltage level.  High  1 and low  0  High  0 and low  1 Normal Logic Normal Logic Inverse Logic Inverse Logic

High and Low Mark Neil - Microprocessor Course 3 CMOS NO MAN ’ S LAND 74HCxx 0.1 – 1.0 Volts 3.5 – 4.9 Volts Transistor Logic (TTL) Transistor Logic (TTL) NO MAN ’ S LAND 74LSxx 0.8 – 0.4 Volts 2.0 – 2.4 Volts It is actually a bit more complicated than this since there are different thresholds for inputs and outputs and their noise margins (indicated here in RED)..

Making a Zero or a One Mark Neil - Microprocessor Course 4 How do you actually make a 0 or 1 ? It is clear that depending upon the position of the J1 switch the line will be either ‘ 0 ’ or ‘ 1 ’ Pull-up resistor

Making a Zero or a One Mark Neil - Microprocessor Course 5 How do you actually make a 0 or 1 in CMOS? 0 +V 1 ? ? “Tri-state” output High impedance “Tri-state” output High impedance BANG! J1 J2

Binary Logic Mark Neil - Microprocessor Course 6 Once the bits are generated, we want to be able to perform various operations on those bits The operations which the microprocessor carries out can all be constructed with a few simple circuits The basic building blocks are logic “gates”

Binary Logic truth tables Mark Neil - Microprocessor Course 7 You may remember from the first year lab the gates AND, OR, NOT Any digital device can be made out of either ORs and NOTs or ANDs and NOTs. You may remember from the first year lab the gates AND, OR, NOT Any digital device can be made out of either ORs and NOTs or ANDs and NOTs.

DeMorgan ’ s Theorem Mark Neil - Microprocessor Course 8 You can swap ANDs with ORs if at the same time you invert all inputs and outputs : Exercise: Write truth table for both and prove that this is correct

An AND out of NOTs and ORs Mark Neil - Microprocessor Course 9 Exercise: Test the claim that you can make any logic device exclusively out of NOTs and ORs by making an AND out of NOTs and ORs:

Answer: Mark Neil - Microprocessor Course 10 Show that this device has an identical truth table as the AND gate.

Exercise: Exclusive OR Mark Neil - Microprocessor Course 11 Construct an exclusive OR (XOR) gate using OR, ANDs, and NOT:

The Exclusive OR Mark Neil - Microprocessor Course 12 Solution:

Addition with Binary Logic Gates J. Nash - Microprocessor Course 13 Example: Adding two 4 bit numbers results in a 4 bit number plus one carry bit or effectively a 5 bit number Lets construct this adder from gates Example: Adding two 4 bit numbers results in a 4 bit number plus one carry bit or effectively a 5 bit number Lets construct this adder from gates Computers carry out addition with binary addition of bits stored in registers We can build additions of large numbers of bits out of units which add two bits $3+$4$3+$C$D+$4$D+$C = 0111= 1111=10001=11001 $7$F$11$19

Additions of two bits: The half adder Mark Neil - Microprocessor Course 14 ABCS Adding two bits generates two bits of output  1 “Sum Bit” S  1 “Carry Bit” C The truth table for this operation is shown along with an implementation using two gates

Full Adder Mark Neil - Microprocessor Course 15 In order to add larger numbers, we need to be able to bring the carry from the lower order bits, and add this to the sum The inputs are:  the two bits to be added (A,B)  The Carry Bit (C) The outputs are:  The Sum Bit (S)  The Carry Out Bit (C+) We can build this from two half adders and an XOR gate ABCC+S

Two bit adder Mark Neil - Microprocessor Course 16 We can construct logic that adds more than 1 bit together by using multiple full adder circuits Exercise: Draw a circuit that adds two two bit words (Ao,A1) and (B0,B1) and produces three Sum Bits (S0,S1,S2) Exercise: Draw a circuit that adds two two bit words (Ao,A1) and (B0,B1) and produces three Sum Bits (S0,S1,S2)

Solution Mark Neil - Microprocessor Course 17 With the Full adder building block we can generalize to produce a circuit which adds larger numbers

Four plus Four bit addition This can clearly be generalized to any number of bits There is a problem in building circuits this way as the carry bits need to propogate through the circuit before the answer is correct There are other ways to construct adder circuits which avoid this problem 18 Mark Neil - Microprocessor Course

Storing Zeros and Ones: Registers Mark Neil - Microprocessor Course 19 Registers are electronic devices  capable of storing 0’s or 1’s D-FLIP-FLOPs are the most elementary registers  can store one bit 8 DFFs clocked together make a one byte register  Capable of storing 8 bits

SR Latch: Set and Reset Mark Neil - Microprocessor Course 20 Gate level design of an SR latch When S* is low and R* High, Q is high (Set) When S* is high and R* is low Q is cleared (Reset) Q and Q* are complements When S* is low and R* High, Q is high (Set) When S* is high and R* is low Q is cleared (Reset) Q and Q* are complements

SR Latch: Hold Mark Neil - Microprocessor Course 21 Gate level design of an SR latch When S* and R* are high both states for Q are possible (and stable) The latch remembers the last state it was in, and holds Q in that state When S* and R* are high both states for Q are possible (and stable) The latch remembers the last state it was in, and holds Q in that state

SR Latch: Don’t do this… Mark Neil - Microprocessor Course 22 Gate level design of an SR latch When S* and R* are low Q and Q* are no longer complementary The latch can also enter a race condition if you try to take S* and R* high again “at the same time” When S* and R* are low Q and Q* are no longer complementary The latch can also enter a race condition if you try to take S* and R* high again “at the same time”

SR Latch: 1 bit memory Mark Neil - Microprocessor Course 23 Gate level design of an SR latch S/R high is ambiguous, but stable This circuit “remembers” that S went low S/R high is ambiguous, but stable This circuit “remembers” that S went low Ambiguous but stable

Gated D Latch Mark Neil - Microprocessor Course 24 Ensures that S and R are always complementary. When the Clock is high – D is set on the outputs of the latch and it is held there when the clock is low Exercise: Fill out the truth table for this circuit. Ensures that S and R are always complementary. When the Clock is high – D is set on the outputs of the latch and it is held there when the clock is low Exercise: Fill out the truth table for this circuit.

D latch timing Mark Neil - Microprocessor Course 25 The input Data to the gated D latch appears on the output (Q)while the clock is high. Sometimes we want to transfer the data into the register only at a specified moment (for example when the clock changes) The Master-Slave D Flip-Flop uses two d-latches to latch the data on the edge (depending on the design either positive or negative) of the input clock

Master Slave – D Flip Flop Mark Neil - Microprocessor Course 26 Data is stored in the “Master” latch (Q m ) when the clock is high When the clock goes from high to low  The data is held in the Master  The Data is stored in the slave latch output The Q s output can only change when the clock goes from high to low

A real D-Flip-Flop (DFF) Mark Neil - Microprocessor Course 27 When S and R are High, on the rising edge of the clock the data are transferred and stored in Q. One can Set or Reset (Clear) the DFF using S or R

4-bit Register Mark Neil - Microprocessor Course 28 A register that stores 4 bits Data coming in D0,D1,D2,D3 Data coming in D0,D1,D2,D3 Data Stored on rising edge of clock in Q0,Q1,Q2,Q3 Data Stored on rising edge of clock in Q0,Q1,Q2,Q3

Byte Register Mark Neil - Microprocessor Course 29 8 bit register in a single package 74F574 Also contains tri-state outputs CLK Byte coming in Byte Stored

Arithmetic Logic Unit (ALU) Mark Neil - Microprocessor Course 30 Centre of every computer Composed of building blocks we have been learning about  Adders  Flip Flops  Registers We also need to have a data bus to move data in and out - we will learn about this soon

Exercise: build an external 1 Byte memory Mark Neil - Microprocessor Course 31 CP (Write Data) Byte coming in (PORTA) Byte coming in (PORTA) Byte Stored (PORTE) Byte Stored (PORTE) Output Enable* (Read Data) * = INVERTED Control lines (PORTD) Control lines (PORTD)

The data sheets of the 74F574 Mark Neil - Microprocessor Course 32

The 74F574 outputs Mark Neil - Microprocessor Course 33 The outputs of the 574 are tri-state : They Can be high ‘1’, low ‘0’, and DISCONNECTED (HIGH IMPEDANCE STATE). The outputs of the 574 are tri-state : They Can be high ‘1’, low ‘0’, and DISCONNECTED (HIGH IMPEDANCE STATE).

The 74F574 Function Table When Output Enable ( OE* ) is low, the data can be read from the register Data can be written to the register at any time by driving the Clock Pulse ( CP ) from low to high 34 Mark Neil - Microprocessor Course

Timing diagram: Load Register – Enable Output Mark Neil - Microprocessor Course 35 CP OE O0-O7 D0-D7 t s = setup time tsts t PZH = Output Enable time t PZH

Timing diagram: write with OE Low Mark Neil - Microprocessor Course 36 CP OE O0-O7 (out) D0-D7 (in) T p = propagation delay tptp