More Basics of CPU Design Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.

Slides:



Advertisements
Similar presentations
The CPU The Central Presentation Unit What is the CPU?
Advertisements

Part 4: combinational devices
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Chapter 7 Henry Hexmoor Registers and RTL
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
Chapter 7. Register Transfer and Computer Operations
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
16/07/2015CSE1303 Part B lecture notes 1 Hardware Implementation Lecture B17 Lecture notes section B17.
Hardware Design of an Arithmetic Logic Unit (ALU) Felix Noble Mirayma V. Rodriguez Agnes Velez University of Puerto Rico Mayagüez Campus Mayagüez, Puerto.
The Computer Processor
Chapter 4 Register Transfer and Microoperations
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
Computer Systems 1 Fundamentals of Computing The CPU & Von Neumann.
Computer Architecture
Lecture 16 Today’s topics: –MARIE Instruction Decoding and Control –Hardwired control –Micro-programmed control 1.
Chapter 6-1 ALU, Adder and Subtractor
Chapter 4 Register Transfer and Micro -operations
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
Chapter 4 CSF 2009 The processor: Building the datapath.
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
Cis303a_chapt04.ppt Chapter 4 Processor Technology and Architecture Internal Components CPU Operation (internal components) Control Unit Move data and.
REGISTER TRANSFER & MICROOPERATIONS By Sohaib. Digital System Overview  Each module is built from digital components  Registers  Decoders  Arithmetic.
General Concepts of Computer Organization Overview of Microcomputer.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
ECE 445 – Computer Organization
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 17: The Processor - Overview Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
Computer Organization CDA 3103 Dr. Hassan Foroosh Dept. of Computer Science UCF © Copyright Hassan Foroosh 2002.
System Unit Working of CPU. The CPU CPU The CPU CPU stands for central processing unit. it is brain of computer It is most important component of the.
Logic Design / Processor and Control Units Tony Diep.
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.
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?
1 3 Computing System Fundamentals 3.2 Computer Architecture.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Combinational Circuits
CS 270: Mathematical Foundations of Computer Science
Basic Processor Structure/design
Chap 7. Register Transfers and Datapaths
Introduction CPU performance factors
Lesson Objectives A note about notes: Aims
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Computer Architecture
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Topic 5: Processor Architecture
Levels in Processor Design
Combinational Circuits
Levels in Processor Design
Digital Circuits and Logic
Information Representation: Machine Instructions
Instruction execution and ALU
Presentation transcript:

More Basics of CPU Design Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Design of a CPU This lecture covers topics basic to the design of a modern CPU, including that of the MIPS. 1.The storage elements used to save data and to save the execution state. 2.The flow of data through the CPU. 3.The control signals that control the CPU Some slides in this lecture will be based on an earlier design (the Boz-5) by your instructor.

Components of a Stored Program Computer 3

The von Neumann Design The CPU interacts with the memory though control signals and two registers. For the MIPS, each of the MAR and MBR is a 32-bit register.

Components of a CPU Here are the main components of a CPU. The control unit interprets the machine language instruction in the IR and emits control signals to cause the CPU to execute that instruction.

The Fetch–Execute Cycle This cycle is the logical basis of all stored program computers. Instructions are stored in memory as machine language. Instructions are fetched from memory and then executed. The common fetch cycle can be expressed in the following control sequence. MAR  PC.// PC contains the address of the instruction. READ.// Put the address into MAR and read memory. IR  MBR.// Place the instruction into the MBR. This sequence is common for all instructions executed.

The ALU (Arithmetic Logic Unit) The ALU performs all of the arithmetic and logical operations for the CPU. These include the following: Arithmetic:addition, subtraction, negation, etc. Logical:AND, OR, NOT, Exclusive OR, etc.

More on the ALU This symbol has been used for the ALU since the mid 1950’s. It shows two inputs and one output. Many operations, such as addition and logical AND, are dyadic; that is, they take two inputs. Monadic operations, such as logical NOT, will use only one of the input busses and ignore the other.

The Structure of One ALU We illustrate the structure of an ALU with the design used on the Boz-5. First, the ALU is divided into four sub-units. Each sub-unit is then designed independently. Modern ALU design is somewhat different.

The Transfer/Not Sub-Unit This is very simple. It contains the following circuit, replicated 32 times.

The Logic Sub-Unit

Logical Left Shift

Sign Extension The MIPS design calls for the sign extension of a 16-bit value, stored in IR 15-0 to a signed 32 bit value for input to the ALU For a 16-bit value, bit 15 is the sign bit. For a 32-bit value, bit 31 is the sign bit.

Examples of Sign Extension in 8–bit in 16–bit – 100 in 8–bit – 100 in 16–bit Rule – just extend the sign bit to fill the new “high order” bits.

Fixed Shift Left by 2 Address calculation in the MIPS calls for multiplication by 4, equivalent to a logical left shift by 2 bits. In contrast to a general shift circuit, which might need to pass the original value, this is very simple. Just connect the input to output as shown here.

Binary Addition We first consider addition of two 1-bit values. Here is the truth table for what is called a “half adder” for A + B; no carry in. ABSumCarry

The Full Adder ABC in SumC out

The Full Adder

The Ripple-Carry Adder ( A Collection of Full Adders)

Another Use of XOR Here is the truth table for the XOR gate. This illustrates one use of the XOR gate.

Two’s-Complement and Subtraction Remember how to negate a number in the two’s-complement system. This leads to the following approach to implementing subtraction

The Add/Subtract Unit B1 + B2 or B1 – B2

Overflow: Busting the Arithmetic The range of 16–bit two’s–complement arithmetic is – 32,768 to 32,767 Consider the following addition problem: Now + 24,576 (binary ) is well within the range – 16384

Detecting Overflow Look at the carry-in and carry-out from the sign bits. Overflow occurs when C 31  C 32 = 1. A 31 B 31 C 31 S um 31 C 32 C 31  C

The CPU Bus Structure The CPU has an internal data bus structure, with three data busses dedicated to the ALU: two for input and one for output. A bus normally has more than one wire, though serial busses are in use. The data busses in MIPS have 32 bits.

What About 1 CPU Bus? This will be too slow, taking 3 time steps to add. Here is the sequence, based on the fact that the bus can carry only 1 thing at a time. T1: R1  Bus, Bus  Y T2: R2  Bus, Add T3: Z  Bus, Bus  R3.

The Three-Bus Solution The three-bus solution allows the ALU to add and update the register in one clock cycle.

The MIPS Solution: One ALU and Two Adders One can design a CPU with one ALU, with the restriction that it can do only 1 thing at a time. The MIPS design calls for two arithmetic operations related to addresses in addition to the standard ALU operations. The solution is to dedicate two adders to address arithmetic in addition to the ALU.

A Bus Connects Two Devices The bus takes one of a number of devices as a data source, and normally has 1 destination.

Connecting Registers to Busses

Selecting the Two Read Registers

Two Options

Chapter 4 — The Processor — 33 Sequential Elements Register: stores data in a circuit Uses a clock signal to determine when to update the stored value Edge-triggered: update when Clk changes from 0 to 1 D Clk Q D Q

Chapter 4 — The Processor — 34 Sequential Elements Register with write control Only updates on clock edge when write control input is 1 Used when stored value is required later D Clk Q Write D Q Clk

Chapter 4 — The Processor — 35 Clocking Methodology Combinational logic transforms data during clock cycles Between clock edges Input from state elements, output to state element Longest delay determines clock period

The Control Unit The function of the CU (Control Unit) is to take the binary information in the IR (Instruction Register) and other status information to generate signals to control the execution of the program in the computer.

Instruction and Data Memory