Transcription

2 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

3 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

4 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

5 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

6 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

7 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

8 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

9 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

10 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

12 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

13 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

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

15 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

16 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

17 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

18 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

19 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

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

23 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 ) followed by a rotate right, but that would involve more processing steps and therefore be slow. Hardware Lecture 14 Slide 23

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

25 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

26 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

Lecture N -1- PHYS 3330 Microcontrollers If you need more than a handful of logic gates to accomplish the task at hand, you likely should use a microcontroller instead of discrete logic gates 1. Microcontrollers

Learning Outcomes Simple CPU Operation and Buses Dr Eddie Edwards eddie.edwards@imperial.ac.uk At the end of this lecture you will Understand how a CPU might be put together Be able to name the basic components

1 Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Decimal to Binary Major Computer Components

Register File, Finite State Machines & Hardware Control Language Avin R. Lebeck Some slides based on those developed by Gershon Kedem, and by Randy Bryant and ave O Hallaron Compsci 04 Administrivia Homework

An Overview of Stack Architecture and the PSC 1000 Microprocessor Introduction A stack is an important data handling structure used in computing. Specifically, a stack is a dynamic set of elements in which

3x3 Convolver with Run-Time Reconfigurable Vector Multiplier in Atmel AT6000 s Introduction Convolution is one of the basic and most common operations in both analog and digital domain signal processing.

What You Will Learn... Computers Are Your Future Chapter 6 Understand how computers represent data Understand the measurements used to describe data transfer rates and data storage capacity List the components

Assembly Language Programming Assemblers were the first programs to assist in programming. The idea of the assembler is simple: represent each computer instruction with an acronym (group of letters). Eg:

7CS-A(CD_lab) Write grammar for a fictitious language and create a lexical analyzer for the same Develop a lexical analyzer to recognize a few patterns in PASCAL and C (ex: identifiers, constants, comments,

Chapter 4 System Unit Components Discovering Computers 2012 Your Interactive Guide to the Digital World Objectives Overview Differentiate among various styles of system units on desktop computers, notebook

Pipeline Hazards Structure hazard Data hazard Pipeline hazard: the major hurdle A hazard is a condition that prevents an instruction in the pipe from executing its next scheduled pipe stage Taxonomy of

The concept of hierarchical design: the views of computer science and engineering students Lambrini Adamopoulou, Maria Kordaki and George Alexiou Department of Computer Engineering and Informatics, Patras

Computer Programming Course Details An Introduction to Computational Tools Prof. Mauro Gaspari: mauro.gaspari@unibo.it Road map for today The skills that we would like you to acquire: to think like a computer

COWLEY COLLEGE & Area Vocational Technical School COURSE PROCEDURE FOR Student Level: This course is open to students on the college level in either Freshman or Sophomore year. Prerequisites: None INTRODUCTION

Exploring Computer Science A Freshman Orientation and Exploratory Course Stephen U. Egarievwe and Vivian J. Fielder Center for Internet Based Education and Research Department of Mathematics and Computer

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering EEC180B Lab 7: MISP Processor Design Spring 1995 Objective: In this lab, you will complete the design of the MISP processor,

April 2014 7 Serial Communications Objectives - To be familiar with the USART (RS-232) protocol. - To be able to transfer data from PIC-PC, PC-PIC and PIC-PIC. - To test serial communications with virtual

Fundamentals of Digital Electronics by Professor Barry Paton Dalhousie University March 998 Edition Part Number 32948A- Fundamentals of Digital Electronics Copyright Copyright 998 by National Instruments

Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine This is a limited version of a hardware implementation to execute the JAVA programming language. 1 of 23 Structured Computer

This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping 3.1.1 Constants, variables and data types Understand what is mean by terms data and information Be able to describe the difference

KABARAK UNIVERSITY UNIVERSITY EXAMINATIONS 2014 / 2015 ACADEMIC YEAR FOR THE DEGREE OF BACHELOR OF COMPUTER SCIENCE AND INFORMATION TECHOLOGY INTE 111: INTRODUCTION TO INFORMATION TECHNOLOGY DAY: THURSDAY

Computer Organization & Architecture Lecture #19 Input/Output The computer system s I/O architecture is its interface to the outside world. This architecture is designed to provide a systematic means of

Preface Aims Audience This book introduces the concepts and methodologies employed in designing a system-on-chip (SoC) based around a microprocessor core and in designing the microprocessor core itself.

1 1 Computer hardware Most computers are organized as shown in Figure 1.1. A computer contains several major subsystems --- such as the Central Processing Unit (CPU), memory, and peripheral device controllers.

Objectives The Central Processing Unit: What Goes on Inside the Computer Chapter 4 Identify the components of the central processing unit and how they work together and interact with memory Describe how

Simplifying Logic Circuits with Karnaugh Maps The circuit at the top right is the logic equivalent of the Boolean expression: f = abc + abc + abc Now, as we have seen, this expression can be simplified

Innovative improvement of fundamental metrics including power dissipation and efficiency of the ALU system Joseph LaBauve Department of Electrical and Computer Engineering University of Central Florida