ALU & CPU Computer Architecture. Introducing ALU ALU: Arithmetic & Logic Unit –Performs arithmetic operations Addition Subtraction –Performs logic operations.

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

ADDER, HALF ADDER & FULL ADDER
Modular Combinational Logic
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Chapter 9 Computer Design Basics. 9-2 Datapaths Reminding A digital system (or a simple computer) contains datapath unit and control unit. Datapath: A.
Digital Logic Circuits (Part 2) Computer Architecture Computer Architecture.
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.
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
1 EECS Components and Design Techniques for Digital Systems Lec 21 – RTL Design Optimization 11/16/2004 David Culler Electrical Engineering and Computer.
Lecture 1: Introduction to Digital Logic Design CK Cheng Tuesday 4/1/02.
Homework Reading Machine Projects Labs
CPEN Digital System Design Chapter 9 – Computer Design
4-bit adder, multiplexer, timing diagrams, propagation delays
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Constructing a Computer Creating a general purpose computing device.
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.
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Introduction to Chapter 6  Digital circuits are frequently used for arithmetic operations  Fundamental arithmetic operations on binary numbers and digital.
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
Functions of Combinational Logic
HCL and ALU תרגול 10. Overview of Logic Design Fundamental Hardware Requirements – Communication: How to get values from one place to another – Computation.
1/8/ L3 Data Path DesignCopyright Joanne DeGroat, ECE, OSU1 ALUs and Data Paths Subtitle: How to design the data path of a processor.
ECEN 248 Lab 4: Multiplexer Based Arithmetic Logic Unit
Digital Electronics Lecture 6 Combinational Logic Circuit Design.
Digital Electronics and Computer Interfacing
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
Chapter 4 Computer Design Basics. Chapter Overview Part 1 – Datapaths  Introduction  Datapath Example  Arithmetic Logic Unit (ALU)  Shifter  Datapath.
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
Logic Design CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Universal college of engineering & technology. .By Harsh Patel)
Ch3b- 2 EE/CS/CPE Computer Organization  Seattle Pacific University There is logic to it andRd, Rs, RtRd
A four function ALU A 00 ADD B MUX SUB 11 Result AND OR
ALU (Continued) Computer Architecture (Fall 2006).
CBP 2002ITY 270 Computer Architecture1 Digital Logic This Time … Control Path, Arithmetic Ops 12 a U1 34 b Last Time …
Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality = A B A = B Two bit strings.
Computer Architecture
CEC 220 Digital Circuit Design
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
CSI-2111 Structure of Computers Ipage Combinational Circuits  Objectives : To recognize the principal types of combinational circuits  Adders.
Lecture 10: Computer Design Basics: The ALU and the Shifter Soon Tee Teoh CS 147.
ECE 2110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Multiplexers.
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
Number Representation (Part 2) Computer Architecture (Fall 2006)
MicroProcessors Lec. 4 Dr. Tamer Samy Gaafar. Course Web Page —
1 To write any register, we need register address and a write signal A 3-bit write address is decoded if write signal is present One of the eight registers.
EE204 L03-ALUHina Anwar Khan EE204 Computer Architecture Lecture 03- ALU.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
MSI Circuits.
Combinational Circuits
CS161 – Design and Architecture of Computer Systems
CS 270: Mathematical Foundations of Computer Science
Computer Science 210 Computer Organization
Computer Design Basics
Chap 7. Register Transfers and Datapaths
Combinational Logic Circuits
Basics of digital systems
Unit5 Combinational circuit and instrumentation system.
EEL 3705 / 3705L Digital Logic Design
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Levels in Processor Design
Multiple function unit design
Computer Design Basics
Combinational Circuits
ECE 352 Digital System Fundamentals
Digital Circuits and Logic
Presentation transcript:

ALU & CPU Computer Architecture

Introducing ALU ALU: Arithmetic & Logic Unit –Performs arithmetic operations Addition Subtraction –Performs logic operations AND: AB OR: A+B NOT: A –Desired operation/result is chosen based on a selection logic.

Exercise Develop a circuit that accepts 3 inputs (say A, B, and C in ) and generates 2 outputs (say Out and C out ) depending on 3 control inputs S 1,S 2, and S 3 as shown in the truth table: S0S0 S1S1 S2S2 OutC out 000ABX 001A+BX 010AX 011BX 100 A  B  C in AB+ BC in + AC in X = Don’t care (can be 1 or 0)

Solution: 1-bit ALU A B Out S0S0 S1S1 S2S2 S0S1S2S0S1S2 AB A+BA+B A B Full Adder C in Sum C out Multiplexer This approach can be extended to include other operations such as subtraction.

n-bit ALU –Repeat 1-bit ALU n times –All 1-bit ALUs get the same selection lines –Carry out (C out )from one stage is wired to carry-in of next state Similar to how a ripple carry adder (or subtraction circuit) is wired –Performs operation on n-bits simultaneously

Example 4-bit ALU ALU 3 ALU 2 ALU 1 ALU 0 A3A3 B3B3 A2A2 B2B2 A1A1 B1B1 A0A0 B0B0 Add/Sub O0O0 O1O1 O2O2 O3O3 O4O4 OP 0 OP 1 OP 2 Selection lines simply renamed to operation code (OPCode) lines Cin

ALU Notation An ALU is denoted using the following graphical notation. ALU Operand1 (A) Operand2 (B) Result Operation Selection (OP Code) Indicates number of bits on each line. The size of each operand is typically the same and corresponds to the word size. 4 OP CodeResult 0 10 AB 1 10 A+BA+B 2 10 A 3 10 B ……

Thought Experiment Where do the inputs to the ALU come from? –The two operands –The operation the ALU needs to perform Similarly where do the outputs from the ALU go? Solution: Registers! –The fundamental storage units.

Fixed number of D-Flip Flops to form a Word –Corresponding to size of ALU operands! –Operate as a single unit Store/Read n-bits at a time D Q CK D Q D Q D Q D0D1D2D3 Q3 Q2Q1 Q0 Registers Revisited

Selecting a Register Given n Registers how to read data from a specific register? Register Register Register Register MUXMUX Register Select 8 Set of registers is called a Register File This is not a single Mux but a set of 8 Mux’s all having the same selection logic!

Selecting 2 Registers ALU needs 2 operands to work! –How to select 2 registers from a Register File? MUX1MUX1 Register Select MUX2MUX2 Register Select Register File Operand1 Operand2

ALU with Inputs ALU Operation 4 Mux1 Mux2 Register File (4) 8 Operand1 2 Operand2 2 Results What do we do with results or output from the ALU?

ALU Output Solution: Put it into a register! OK, so do we do that? –That is, Given 1 input how to route it on n different paths? Result from ALU Select Inputs 2 DeMux Register 1 Register 2 Register 3 Register 4

Handling ALU Output ALU Operation 4 Mux1 Mux2 Register File (4) Flags DeMux Operand1 2 Operand2 2 Destination 2 A B Each device has its own slection logic typically specified using a truth table! OperationResult 0 10 AB 1 10 A+BA+B 2 10 A Clock

Data path The ALU and associated components constitute the Data Path –Includes Registers, Multiplexers and any other device associated with ALU operations –All operands are typically the same size Register sizes match with size of operand –Size of operands are associated with CPU 32-bit processor (ALU uses 32-bit operands) 64-bit processor (ALU uses 64-bit operands)