5. Combinational circuits

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

Combinational Circuits
Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
Computer Structure - The ALU Goal: Build an ALU  The Arithmetic Logic Unit or ALU is the device that performs arithmetic and logical operations in the.
ECE 301 – Digital Electronics
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
CS 105 Digital Logic Design
Top-down modular design
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
+ CS 325: CS Hardware and Software Organization and Architecture Combinational Circuits 1.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 7: 32-bit ALU, Fast Carry Lookahead Instructor: Ashraf Yaseen DEPARTMENT OF MATH &
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
DIGITAL CIRCUITS David Kauchak CS52 – Fall 2015.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
MIPS ALU. Building from the adder to ALU ALU – Arithmetic Logic Unit, does the major calculations in the computer, including – Add – And – Or – Sub –
Logic Design / Processor and Control Units Tony Diep.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
Computer Architecture Lecture 9 MIPS ALU and Data Paths Ralph Grishman Oct NYU.
1 Fundamentals of Computer Science Combinational Circuits.
1 ECE 545—Digital System Design with VHDL Lecture 1 Digital Logic Refresher Part A – Combinational Logic Building Blocks.
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Schematics adapted from those provided by the authors Hennessey and Patterson.
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?
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
MIPS ALU. Exercise – Design a selector? I need a circuit that takes two input bits, a and b, and a selector bit s. The function is that if s=0, f=a. if.
Simple ALU  Half adder  Full adder  Constructing 4 bits adder  ALU does several operations  General ALU structure  Timing diagram of adder  Overflow.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Combinational Circuits
CS161 – Design and Architecture of Computer Systems
Prof. Sin-Min Lee Department of Computer Science
ECE 3130 Digital Electronics and Design
Lecture 11: Hardware for Arithmetic
Computer Architecture & Operations I
Computer Science 210 Computer Organization
Morgan Kaufmann Publishers The Processor
Combinational Circuit Design
Basics of digital systems
Morgan Kaufmann Publishers
MIPS ALU.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
MIPS ALU.
Systems Architecture I
Rocky K. C. Chang 6 November 2017
Digital Logic.
Lecture 11: Hardware for Arithmetic
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Systems Architecture I
COMS 361 Computer Organization
A 1-Bit Arithmetic Logic Unit
Logic Circuits I Lecture 3.
Combinational Circuits
XOR Function Logic Symbol  Description  Truth Table 
Digital Circuits and Logic
Arithmetic Circuits.
Instruction execution and ALU
MIPS ALU.
MIPS ALU.
Presentation transcript:

5. Combinational circuits Rocky K. C. Chang 17 October 2017

Goals of this lecture Understand how multiplexers, decoders, and demultiplexers, which are basic building blocks for digital circuits are implemented. Understand how different arithmetic and logic functions are implemented in an ALU. Understand the circuit delay and its relation to sequential circuit.

Multiplexer: use case Update the PC either from PC + 4 or PC + 4 + immediate

Multiplexer: logic circuit Component Symbol Truth Table Implementation

Decoder: use case A decoder is a combinational circuit with a number of output lines, only one of which is asserted at any time. For example, it can be used to implement the write port for a register file.

Decoder: logic circuit In general, a decoder has n inputs and 2n outputs. For a 2-to-4 decoder: A0 A1 D0 D1 D2 D3 1 2-to-4 Decoder D0 D1 D2 D3 A1 A0

For a 3-to-8 decoder

Demultiplexer With an additional input line, a decoder can be used as a demultiplexer. The demultiplexer connects a single input to one of several outputs. The n inputs act as an address to select a particular output line. The value on the data input line (0 or 1) is routed to that output line. The data input could be viewed as an Enabled.

A basic ALU 1-bit logic unit 1-bit adder One AND, one OR and one multiplexer Operation (0/1) controls the output. 1-bit adder Inputs a and b are two bits to be added. CarryIn: a carry bit from another adder CarryOut: a carry bit generated from this adder

1-bit adder (full adder)

A 32-bit ALU The 32-bit ALU is created by chaining 32 1-bit ALU. Subtraction is supported by setting Binvert and CarryIn to 1 for ALU0. 1-bit a +/OR/AND b and a + 𝑏 for subtraction 1-bit a +/OR/AND b

Review questions Verify the fuller adder’s Boolean functions for Sum and CarryOut using Karnaugh map. How many AND and OR gates do you need to implement the full adder, assuming that you could use multi-input gates? How do you reduce the number of gates for Sum?

Adding NOR and NAND to the ALU This enhanced ALU supports also NOR and NAND. These different operations are controlled by setting Ainvert, Binvert, and Operation.

Adding support for SLT (1/3) Test a < b or a – b < 0. Expand the 3-input multiplexer by one more input called Less. Connect 0 to the Less input for the upper 31 bits of the ALU. The least significant bit (LSB) should be set to 1 for a – b < 0 and 0 otherwise. Connect the sign bit from the adder output to the LSB.

Adding support for SLT (2/3) But the ALU output for the slt operation is the input value Less, instead of the adder’s. Need a new 1-bit ALU for the MSB that has an extra output bit called Set: the adder output. Also add the overflow detection logic since it is also associated with that bit. Only for block 31

Adding support for SLT (3/3) Block 31 is different from blocks 0 – 30. Block 31 also supports overflow detection.

Adding support for conditional branching Test a = b, or a - b = 0. Add hardware to test if the result is 0: Zero = NOT Result0 AND NOT Result1 AND … NOT Result30 AND NOT Result31

Controlling the ALU’s output Use the 1-bit Ainvert line, the 1-bit Binvert line, and the 2-bit Operation lines as 4-bit control lines for the ALU.

Circuit delay A measure of the delay from input to output is called propagation delay. The propagation delay of a circuit, like the adder, is always less than the clock period. CS61c: Introduction to Synchronous Digital Systems by J. Wawrzynek

Clock All operations coordinated by a central clock (“heartbeat” of the system!) Edge-triggered clocking Either the rising edge or the falling edge of the clock is active and causes state changes to occur.

conclusions

Acknowledgements This set of slides is mainly based on Appendix B5 of David Patterson and John Hennessy, Computer Organization and Design, 5th edition, Morgan Kaufmann, 2014.