Let s put together a Manual Processor

Similar documents
REGISTER TRANSFER LANGUAGE

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Computer Architecture and Organization: L04: Micro-operations

IA Digital Electronics - Supervision I

ELCT 501: Digital System Design

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Von Neumann Architecture

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

Arithmetic Circuits. Design of Digital Circuits 2014 Srdjan Capkun Frank K. Gürkaynak.

Reference Sheet for C112 Hardware

In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified.

A 32-bit Processor: Sequencing and Output Logic


For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

Register Transfer and Micro-operations

EXPERIMENT NUMBER 11 REGISTERED ALU DESIGN

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

Parallel logic circuits

A mathematician has asked us to design a simple digital device that works similarly to a pocket calculator.

Experiment 7 Arithmetic Circuits Design and Implementation

Keywords: Soft Core Processor, Arithmetic and Logical Unit, Back End Implementation and Front End Implementation.

Arithmetic-logic units

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

Arithmetic Logic Unit. Digital Computer Design

Submitted by 1

CS101 Lecture 25: The Machinery of Computation: Computer Architecture. John Magee 29 July 2013 Some material copyright Jones and Bartlett

Addition and multiplication

32 bit Arithmetic Logical Unit (ALU) using VHDL

Contents. Chapter 9 Datapaths Page 1 of 28

Chapter 4. The Processor

COMBINATIONAL LOGIC CIRCUITS

Computer Arithmetic Multiplication & Shift Chapter 3.4 EEC170 FQ 2005

Chapter 3: part 3 Binary Subtraction

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

CPU Design John D. Carpinelli, All Rights Reserved 1

CS 261 Fall Mike Lam, Professor. Combinational Circuits

CS 151 Midterm. (Last Name) (First Name)

Lecture 21: Combinational Circuits. Integrated Circuits. Integrated Circuits, cont. Integrated Circuits Combinational Circuits

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

Introduction to Digital Logic Missouri S&T University CPE 2210 Multipliers/Dividers

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 3 DLD P VIDYA SAGAR

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

How does the CPU execute programs? Nils Jansen December 5, 2017 (Based on slides by Jeroen Keiren and Niek Janssen)

ARM processor organization

Binary Adders: Half Adders and Full Adders

Chapter 4. The Processor Designing the datapath

LECTURE 4. Logic Design

CSC 220: Computer Organization Unit 10 Arithmetic-logic units

EE 3170 Microcontroller Applications

Computer Organization

Two-Level CLA for 4-bit Adder. Two-Level CLA for 4-bit Adder. Two-Level CLA for 16-bit Adder. A Closer Look at CLA Delay

User. Application program. Interfaces. Operating system. Hardware

ECE 274 Digital Logic. Digital Design. Datapath Components Subtractors, Two s Complement, Overflow, ALUs, Register Files Digital Design

Computer Organization and Levels of Abstraction

An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

Computer Organization and Levels of Abstraction

CS140 Lecture 03: The Machinery of Computation: Combinational Logic

THE MICROPROCESSOR Von Neumann s Architecture Model

Implementation of Low Power High Speed 32 bit ALU using FPGA

Embedded Systems Ch 15 ARM Organization and Implementation

Chapter 4 Arithmetic

The Manual Processor. Lecture 17. Registers: The Multiplexers: The Arithmetic and Logic Unit. The Shifter (This is just a special multiplexer)

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

ECE 341. Lecture # 6

Hardware Description Language VHDL (1) Introduction

ALU Design. 1-bit Full Adder 4-bit Arithmetic circuits. Arithmetic and Logic Unit Flags. Add/Subtract/Increament/Decrement Circuit

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Tailoring the 32-Bit ALU to MIPS

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )


Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

Week 6: Processor Components

CS429: Computer Organization and Architecture

Module 5 - CPU Design

Arithmetic Logic Unit

Systems Programming. Lecture 2 Review of Computer Architecture I

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

Fast Arithmetic. Philipp Koehn. 19 October 2016

Introduction to Field Programmable Gate Arrays

Chapter 4. The Processor

UNIT I STRUCTURE OF COMPUTERS

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

Computer Architecture and Organization:

CS Computer Architecture

Lecture #21 March 31, 2004 Introduction to Gates and Circuits

Lab Assignment 1. Developing and Using Testbenches

Combinational Circuits

EKT 422/4 COMPUTER ARCHITECTURE. MINI PROJECT : Design of an Arithmetic Logic Unit

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

Introduction to Boole algebra. Binary algebra

Transcription:

Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1

The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce a result. Processors can be operated in different ways for example as: A central processor unit (CPU) A peripheral of another computer Array Processor Graphics Processor (GPU) A manually programmed processor Stand alone calculator We will now design a manual (or externally programmed) processor. Hardware Lecture 14 Slide 2

The Block Diagram of a Processor Both the data and the instructions will be binary numbers. The processing will be a sequence of one or more steps controlled by a clock. The result will be a binary number. Hardware Lecture 14 Slide 3

An 8 bit processor architecture We will base our design on the von Neumann architecture (1945) which subdivided the components of a processor into arithmetic units and registers, and had a common input stream for data and instructions. We will carry out processing on 8 bit bytes (similar to the processors of the 1970 s). Hardware Lecture 14 Slide 4

The Actions of a Simple Processor As an example we will find the average of two numbers. Result = (A+B)/2 Because of our choice of architecture all numbers must be represented in 8 bits. Thus the sum A+B must be less than 256. We will see later on how to extend the processing to cope with larger numbers. Hardware Lecture 14 Slide 5

The Actions of a Simple Processor The following steps are carried out: 1. The first number is set up on the input lines and stored in a register (A) 2. The second number is set up on the input lines and stored in a register (B) 3. The arithmetic circuits are set up to add register A to register B. 4. The resulting sum of A and B is transferred back into register A. 5. The shifting circuits are set up to shift the contents of register A one bit to the right. 6. The result is loaded onto an output register (Res). The processor is a sequential digital circuit Hardware Lecture 14 Slide 6

Designing a Processor From the example we see that we need a number of different components to make our processor: Registers: Registers to store the input data (A) & (B) A register to store the result (Res) A one bit register to store the carry (C)(if any) A register to store the instruction (IR) Arithmetic Circuits: An 8 bit adder An 8 bit shifter Hardware Lecture 14 Slide 7

The data path diagram The example also suggests that the registers and arithmetic units must be connected in a specific way. A simple data path diagram might be: Hardware Lecture 14 Slide 8

The data path diagram Note the following about the data path diagram: There is no information about when the data transfers occur. The diagram shows only the possible paths where data can be transferred. The arithmetic and shift operations are done by combinational circuits without more registers. The function of the arithmetic circuits are controlled by the bits in the instruction register. The processor is unable to execute further operations on the results register. Hardware Lecture 14 Slide 9

The Arithmetic-Logic Unit (ALU) We now design one important component of the central processor unit - the ALU - which carries out arithmetic or logic operations on its two inputs A and B. We will design a 4-bit unit that can be used as a building block to construct ALUs of any precision. The select lines (S2, S1, S0) determine the function of A and B that appears on the output. Hardware Lecture 14 Slide 10

The ALU functions The selection bits determine which out of 8 possible functions is used. Selection Function 000 0 001 B-A 010 A-B 011 A plus B 100 A XOR B 101 A OR B 110 A AND B 111-1 When Cin = 1 three operations change: 011: Res = A plus B plus 1 010: Res = A - B - 1 001: Res = B - A - 1 Hardware Lecture 14 Slide 11

Designing the ALU An arithmetic logic unit is a simple combinatorial circuit that can be built from components that we have already designed. To provide the arithmetic functions we use adders and subtractors. Hardware Lecture 14 Slide 12

Designing the ALU The logic functions are provided by simple gates. We need a multiplexer for each bit of the ALU to make the function selection. Hardware Lecture 14 Slide 13

Designing the ALU To finish the job we need one more multiplexer to provide the carry out. Hardware Lecture 14 Slide 14

Extending the ALU to 8 bits We can now follow the functional approach and extend our ALU to 8 bits Similarly we can scale it up to 32 bits or larger as the need arises. Hardware Lecture 14 Slide 15

Organising the Carry We can use a 2-to-1 multiplexer to allow two different carry input bits. The Carry in may be set to 1 or to the previous Carry out. The carry may be set to zero by setting the register C to zero. Thus the full range of arithmetic operations can be used. Hardware Lecture 14 Slide 16

Problem Why set the carry this way? Wouldn t it be simpler to connect the multiplexer inputs to 1 & 0 rather than using register C? Hardware Lecture 14 Slide 17

The Shifter Earlier in the course we discussed a specialised register, called the shift register, which could shift its contents let or right depending on a multiplexer selection. We could incorporate such a shift register in our design, but instead we will make use of a simpler shifter which does not store the result. We can achieve all the functionality we need by using multiplexers, and avoid the need for complex clocking arrangements. Hardware Lecture 14 Slide 18

A four function Shifter Our first shifter design will have four functions determined by two selection bits and will have a data length of eight bits. Hardware Lecture 14 Slide 19

The Shifter Functions The basic shifter will perform four operations depending on its two control inputs. These are: 00 Hold 01 Shift left with carry 10 Arithmetic shift right 11 Rotate right It is implemented simply using one multiplexer per bit. Hardware Lecture 14 Slide 20

Arithmetic Shifts Left Shift with Carry Arithmetic Right Shift Rotate Right Hardware Lecture 14 Slide 21

The four function shifter circuit 00 (A) 01 (B) 10 (C) 11 (D) Hold Shift Left with Carry Arithmetic Shift Right Rotate Right Hardware Lecture 14 Slide 22

Adding more functions to the Shifter There are many other different possible shifts that programmers may want to use. One example is: Logical Shift Right: This could be done by using first an ALU operation (Data AND 11111110) followed by a rotate right, but that would involve more processing steps and therefore be slow. Hardware Lecture 14 Slide 23

The eight function shifter A variety of useful shifts are defined in this table. F[2] F[1] F[0] Shift Carry Function 0 0 0 unchanged 0 0 1 left rotate left 0 1 0 left 0 arithmetic left shift 0 1 1 left Cin left shift with carry 1 0 0 right rotate right 1 0 1 right 0 logical right shift 1 1 0 right Input[7] arithmetic right shift 1 1 1 right Cin shift right with carry Hardware Lecture 14 Slide 24

The circuit of the eight function shifter It is a trivial matter to design a similar shifter of any precision. Hardware Lecture 14 Slide 25

The Data Path Diagram Again We now can put more detail onto the data path diagram: Note that we have not used the Cin input to the shifter in this processor. It will be connected to logic-0. Hardware Lecture 14 Slide 26