Designing an ALU Taken from various sources Primary source: Digital Design and Computer Architecture by Harris &Harris.

Slides:



Advertisements
Similar presentations
ADDER, HALF ADDER & FULL ADDER
Advertisements

Sequential Logic in Verilog
Supplement on Verilog adder examples
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
FSM Revisit Synchronous sequential circuit can be drawn like below  These are called FSMs  Super-important in digital circuit design FSM is composed.
Chapter 9 Computer Design Basics. 9-2 Datapaths Reminding A digital system (or a simple computer) contains datapath unit and control unit. Datapath: A.
Tutorial: Wednesday Week 3 Hand in on Monday, Do the questions for tutorials 1 & 2 at the back of the course notes (answers to tutorial 3 will be published.
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
* CPU (Central Processing Unit ) * CPU is the abbreviation for central processing unit. the CPU is the brains of the computer where most numerical and.
Lecture # 12 University of Tehran
Arithmetic logic unit (ALU)
Arithmetic Logic Unit ALU By: Ahmad Yazdankhah CS 147 Fall 2008 Prof: Dr. Sin-Min Lee.
Engineering 100 Section 250 Combinational Logic -- Examples 9/13/2010.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar.
Logic Gates & Boolean Algebra Chin-Sung Lin Eleanor Roosevelt High School.
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Session 3 Process and organize data 1. Terminology 2 For a list of computer and internet terminology, please see the.
ECEn 191 – New Student Seminar - Session 9: Microprocessors, Digital Design Microprocessors and Digital Design ECEn 191 New Student Seminar.
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
HCL and ALU תרגול 10. Overview of Logic Design Fundamental Hardware Requirements – Communication: How to get values from one place to another – Computation.
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
What is an And Gate? It is a digital circuit that produce logical operations The logical operations are call Boolean logical Boolean operation consist.
1/8/ L3 Data Path DesignCopyright Joanne DeGroat, ECE, OSU1 ALUs and Data Paths Subtitle: How to design the data path of a processor.
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
CS3350B Computer Architecture Winter 2015 Lecture 5.4: Combinational Logic Blocks Marc Moreno Maza [Adapted from lectures.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
1 COMS 161 Introduction to Computing Title: Computing Basics Date: September 15, 2004 Lecture Number: 10.
Logic Gates & Boolean Algebra Chin-Sung Lin Eleanor Roosevelt High School.
Universal college of engineering & technology. .By Harsh Patel)
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
MIPS ALU. Building from the adder to ALU ALU – Arithmetic Logic Unit, does the major calculations in the computer, including – Add – And – Or – Sub –
1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions.
CENTRAL PROCESSING UNIT. CPU Does the actual processing in the computer. A single chip called a microprocessor. Composed of an arithmetic and logic unit.
1 Arithmetic, ALUs Lecture 9 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Introduction to Verilog. Data Types A wire specifies a combinational signal. – Think of it as an actual wire. A reg (register) holds a value. – A reg.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
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.
How does a Computer Add ? Logic Gates within chips: AND Gate A B Output OR Gate A B Output A B A B
Introduction to Verilog. Structure of a Verilog Program A Verilog program is structured as a set of modules, which may represent anything from a collection.
Discrete Systems I Lecture 10 Adder and ALU Profs. Koike and Yukita.
Explain Half Adder and Full Adder with Truth Table.
Lecture 3 ALU and Carry Generator using FPGA 2007/09/21 Prof. C.M. Kyung.
Logic Gates Learning Objectives Learn that there is a one-to-one relationship between logic gates and Boolean expressions Learn how logic gates are combined.
Arithmetic Logic Unit ALU
Combinational Circuits
Logic Gates & Boolean Algebra
Designing Combinational Logic Circuits in Verilog - 1
Lecture 11: Hardware for Arithmetic
Introduction to Verilog
Chapter 2.3 Binary Logic.
Introduction to Verilog
Instructors: Randy H. Katz David A. Patterson
5. Combinational circuits
Arithmetic Circuits (Part I) Randy H
Computer Architecture and Design Lecture 6
Lecture 11: Hardware for Arithmetic
Number Systems and Circuits for Addition
Adders.
Register-Transfer Level Components in Verilog
Introduction to Verilog
Combinational Circuits
Understand the interaction between computer hardware and software
Introduction to Verilog
XOR Function Logic Symbol  Description  Truth Table 
Introduction to Verilog
Design of Digital Circuits Lab 5 Supplement: Implementing an ALU
Presentation transcript:

Designing an ALU Taken from various sources Primary source: Digital Design and Computer Architecture by Harris &Harris

ALU An arithmetic logic unit (ALU) – Performs arithmetic and logic operations – A fundamental building block of the Central Processing Unit (CPU) of a computer – Even the simplest microprocessors contain one for purposes such as maintaining timers – A combinational logic circuit

Complex ALU

Simple ALU The S input is controlled by the processor based on the op code

5 full adder from a previous lecture Adder

Adder/Subtractor

Textbook ALU

Our Target ALU, N=32 The F input is controlled by the processor based on the op code

Possible Implementation module alu (input [31:0] A, B, input [2:0] F, output reg [31:0] Y); // implement everything using a case statement??? (*) case (..) … endcase endmodule

An Implementation From Harris Text: a simple ALUa simple ALU A cover a cover a cover a cover a cover a cover a cover a cover

Test Cases

Test the Implementation A simple testbench A cover a cover a cover a cover a cover a cover a cover a cover

ALU Enhancements 1.Add a Zero output to the ALU. The output is TRUE when Y==0, otherwise it is FALSE. 1.Add and Overflow output to the ALU. The output is TRUE when the result of the adder overflows, otherwise it is FALSE.

An Implementation From Harris Text: an enhanced ALUan enhanced ALU A cover a cover a cover a cover a cover a cover a cover a cover

A Better Testbench Improved Testbench Data file