ASSIGNMENT ECE514 (COMPUTER ORGANIZATION) ASSIGNMENT NO. 3

Similar documents
Chapter 16. Control Unit Operation. Yonsei University

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Digital System Design Using Verilog. - Processing Unit Design

William Stallings Computer Organization and Architecture

General purpose registers These are memory units within the CPU designed to hold temporary data.

C.P.U Organization. Memory Unit. Central Processing Unit (C.P.U) Input-Output Processor (IOP) Figure (1) Digital Computer Block Diagram

Chapter 5. Computer Architecture Organization and Design. Computer System Architecture Database Lab, SANGJI University

Computer Architecture

STRUCTURE OF DESKTOP COMPUTERS

Register Transfer and Micro-operations

Chapter 05: Basic Processing Units Control Unit Design. Lesson 15: Microinstructions

session 7. Datapath Design

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

EE 3170 Microcontroller Applications

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

Chapter 4 The Von Neumann Model

Faculty of Engineering Systems & Biomedical Dept. First Year Cairo University Sheet 6 Computer I

Class Notes. Dr.C.N.Zhang. Department of Computer Science. University of Regina. Regina, SK, Canada, S4S 0A2

Microcomputer Architecture and Programming

A 32-bit Processor: Sequencing and Output Logic

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

REGISTER TRANSFER LANGUAGE

Processing Unit CS206T

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

Introduction to CPU architecture using the M6800 microprocessor

Pin Description, Status & Control Signals of 8085 Microprocessor

Computer Organization II CMSC 3833 Lecture 33

The register set differs from one computer architecture to another. It is usually a combination of general-purpose and special purpose registers

The Itanium Bit Microprocessor Report

SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017

Basics of Microprocessor

Systems Architecture

Tutorial 4: Computer Organization

CPU Design John D. Carpinelli, All Rights Reserved 1

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE

SCRAM Introduction. Philipp Koehn. 19 February 2018

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

Chapter 4 The Von Neumann Model

MICROPROGRAMMED CONTROL

csitnepal Unit 3 Basic Computer Organization and Design


Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

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

E3940 Microprocessor Systems Laboratory. Introduction to the Z80

Philadelphia University Department of Computer Science. By Dareen Hamoudeh

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

Lecture-15 W-Z: Increment-Decrement Address Latch:

Chapter 3 : Control Unit

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Computer Architecture and Organization: L09: CPU Organization

There are four registers involved in the fetch cycle: MAR, MBR, PC, and IR.

REGISTER TRANSFER AND MICROOPERATIONS

Microprocessor Architecture

COMPUTER ORGANIZATION

Microprocessors/Microcontrollers

Chapter 4 The Von Neumann Model

ECE 375 Computer Organization and Assembly Language Programming Winter 2018 Solution Set #2

Blog -

Computer Architecture Programming the Basic Computer

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN


CS2630: Computer Organization Homework 3 Combinational logic and Logisim Due October 14, 2016, 11:59pm

Introduction to Computer Engineering. CS/ECE 252 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin Madison

Blog -

Introduction to Electronics Workbench

Module 5 - CPU Design

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle

1. Fundamental Concepts

DC57 COMPUTER ORGANIZATION JUNE 2013

CISC Processor Design

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

Unit II Basic Computer Organization

16.1. Unit 16. Computer Organization Design of a Simple Processor

Question 1: What criteria define Von Neumann architecture? Identify clearly and coherently. Solution

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

CC312: Computer Organization

REGISTER TRANSFER AND MICROOPERATIONS

Lecture 11: Control Unit and Instruction Encoding

address ALU the operation opcode ACC Acc memory address

History and Basic Processor Architecture

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180A DIGITAL SYSTEMS I Winter 2015

THE MICROPROCESSOR Von Neumann s Architecture Model

Programming Model 2 A. Introduction

UNIT:2 BASIC COMPUTER ORGANIZATION AND DESIGN

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

BASIC COMPUTER ORGANIZATION AND DESIGN

Computer Logic II CCE 2010

In this lecture, we will look at how storage (or memory) works with processor in a computer system. This is in preparation for the next lecture, in

Chapter 20 - Microprogrammed Control (9 th edition)

Chapter 1: Basics of Microprocessor [08 M]

Computer Organization and Design

Von Neumann Architecture

Computer Architecture 2/26/01 Lecture #

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

Transcription:

ASSIGNMENT ECE514 (COMPUTER ORGANIZATION) ASSIGNMENT NO. 3 This is an individual assignment for ECE514. It carries a mark of 10%. The rubric of marks is given in Appendix 3. This assignment is about designing a Control Unit of a simple CPU by using a hardwired implementation. The CPU has been designed for you by using Logisim. However, the Control Unit is empty. By using Logisim, you will design the circuit for the Control Unit. After that, you have to test the CPU. Materials needed: 1) Logisim software (downloadable free at http://www.cburch.com/logisim/ or in i-learn). The size is approximately 7MB. You can run it straight from your pen drive without installation. However, your PC must be first installed with java (http://java.com click at the Free Java Download button). 2) Logisim project file (filename: mycomputerv6(3).circ) given by lecturer. Tasks: a) A CPU block diagram is given in Figure 1. The CPU can recognize 2 instructions given in Table 1 below. Instruction Table 1 Operation load address ACC address subb ACC RAM[ACC] - ACC 1

to external RAM a + 1 PC MAR ACC b c d e f g i j Internal Bus IR opcode 1 to 2 decoder load subb address a m h MDR k from/to external RAM in1 in2 ALU result l Temp sel0 sel1 m read write T0 Control Unit T14 sel0 sel1 clock shift register reset Figure 1 Notes on the CPU diagram of Figure 1: i) PC Program Counter Register, MAR Memory Address Register, MDR Memory Data Register, ALU Arithmetic Logic Unit, IR Instruction Register, Temp Temporary Register, opcode opcode register, address address register, ACC accumulator register. ii) The size of opcode register = size of address register = size of all other registers = 8 bits. iii) The ALU can perform 4 operations add, subtract, increment and decrement based on the values of sel0 and sel1 as shown below: If sel1 = 0 and sel0 = 0, add operation is performed (i.e. result in1 + in2). If sel1 = 0 and sel0 = 1, subtract operation is performed (i.e. result in1 - in2). If sel1 = 1 and sel0 = 0, increment operation is performed (i.e. result in1 + 1). If sel1 = 1 and sel0 = 1, decrement operation is performed (i.e. result in1-1). iv) The read and write signals are connected to external RAM. v) The CPU control signals are labelled as a to m, read, write, sel0, sel1 and reset. 2

b) Based on Figure 1, the sequence of micro-operations for the fetch & decode cycles of the CPU are given in Table 1A below: Table 1A Clock cycle Activated control signals T0 b, c T1 read, k, a T2 j, f T3 - c) Based on Figure 1, the sequence of micro-operations for instruction load address are given in Table 1B below: Table 1B Clock cycle Activated control signals T4 b, c T5 read, k, a T6 j, g T7 h, d, reset Question 1A: Based on Figure 1, write the sequence of micro-operations for instruction subb. Write your answer in page 1 of your report. Question 1B: Based on the sequence of micro-operations in (b), (c) and Question 1A, write the Boolean equations for all the control signals (i.e. a to m, read, write, sel0, sel1 and reset). Write your answer in page 1 of your report. Question 1C: Then, open the mycomputerv6(3).circ by using Logisim (i.e. click menu item File Open). By using the Boolean equations obtained in Question 1B, create digital circuits inside the CPU s Control Unit by using AND and OR gates. To do this, refer to steps (d) (g) below. Make a screen capture of the completed circuit and paste it in page 2 of your report. Appendix 1 shows how to make a screen capture in Logisim. 3

Add Wire AND and OR gates Double Click here to go into the Control Unit Figure 2A: Project Pane d) After the file mycomputerv6(3).circ is opened, the project pane on the left will display as shown in Figure 2A. Double - click the CONTROL UNIT to go inside the CPU s Control Unit. The Control Unit is empty as shown in Figure 2B below. 4

In mycomputer(3).circ, you should view this pin as subb, not adda. Figure 2B: Control Unit e) Figure 2B shows the internal of CPU s Control Unit. It consists of only input pins (square shapes) and output pins (round shapes). The input pins are labelled as load, subb and T0 to T14. The output pins are labelled a to m, read, write, sel0, sel1 and reset. f) You will create your digital circuits inside the CONTROL UNIT by connecting together the inputs (load, subb and T0-T14) to the control signals (a to m, read, write, sel0,sel1 and reset) through AND and OR gates. 5

Click OR gate In mycomputer(3).circ, you should view this pin as subb, not adda. Drop OR gate here Figure 2C By default, the OR gate has 5 inputs and facing east as shown in Figure 2C. If you need 2 inputs and facing north, you can change it by changing its Facing property to North and Number of Inputs to 2 as shown in Figure 2D. 6

In mycomputer(3).circ, you should view this pin as subb, not adda. The OR gate properties Figure 2D Similar process applies to the AND gate. 7

To create a circuit, for example, if you have a Boolean equation for output a as shown below, a = T0 + (T1 & load) the circuit would be as shown in Figure 2E. A wire is obtained by holding down the left mouse button and dragging the mouse from one point to another. Just make sure the Add wire button is selected. To connect wires, make sure this button is selected In mycomputer(3).circ, you should view this pin as subb, not adda. Figure 2E 8

g) IMPORTANT! OUTPUT PINS MUST NEVER BE LEFT UNCONNECTED. For example, as shown in Figure 2E, output pins read, write and b are output pins that are left unconnected (i.e. not connected to anywhere). Unconnected output pins have a colour of blue with X in it. After you have completed your circuits, if there are any output pins not connected to anywhere (i.e. having Boolean equation, for examples, b = 0, read = 0, write = 0), you MUST connect them to GROUND as shown in the example in Figure 2F for output pins read, write and b. Select GROUND under category WIRING In mycomputer(3).circ, you should view this pin as subb, not adda. Figure 2F 9

The GROUND connection is selected from the Project Pane by clicking the Ground icon under the category Wiring and dropping it on the canvas as shown in Figure 2F. Note: Please SAVE your work regularly. You can refer the Tutorials in the HELP menu for reference on using Logisim. CPU Testing h) After you have completed creating the circuits in the Control Unit, you will test your CPU whether it can fetch and execute instructions load and subb correctly. To do that, you must work in the Computer view as shown in Figure 3A below. Double Click here to go into the COMPUTER view Figure 3A 10

The circuit of COMPUTER is as shown in Figure 3B. It consists of a CPU connected to a RAM. Figure 3B: The Computer The RAM is where the instructions and data are stored. Each instruction consists of the opcode and operand part. Instructions are stored in the RAM as hex numbers. The hex numbers for each instruction is called the machine code. The machine codes for each instruction in Table 1 is shown in Table 2 below: Table 2 Instruction Machine Code (hex) Opcode Operand load address 00 8-bit value stated by the address subb 01 - So, for example, instruction load 08 would be represented by hex numbers 00 08. i) Let s test the CPU by using the following program in Figure 3C: load 08 ; load ACC with 08 (hex) subb ; Perform the following subtract operation: ; The content of RAM at location pointed by ACC minus ; ACC. The result of subtraction is then loaded into ACC. Figure 3C 11

For instruction load 08, it is represented by hex number 00 08 (i.e. 00 is the opcode field and 08 is the operand field.) For instruction subb, it is represented by hex number 01 (i.e. 01 is the opcode field and no operand field) You must place 00 08 and 01 in the RAM, starting at RAM address 00 as shown in Figure 4 and Figure 5 below: Right-click the RAM. Then choose Edit Contents. Figure 4 This Hex Editor will appear after Edit Contents is chosen. 12

Key in 00 08 and 01 here. Figure 5 After editing the content of RAM, click Close Window button to close the Hex Editor. You should see the RAM contents as in Figure 6 below: 13

00 08 and 01 representing instructions load 08 and subb respectively. Figure 6 Note that, instruction subb will perform subtraction of the number stored in RAM location pointed by ACC (i.e at RAM location 08) with ACC. So, put a 1-byte number at RAM location 08. Let s say the number at RAM location 08 is 02. So, open the RAM Hex Editor again (as shown in Figure 4) and place 02 in RAM location 08 as shown in Figure 7: Key in 02 at RAM location 08 here. 14

Figure 7 After editing the content of RAM, click Close Window button to close the Hex Editor. You should see the RAM contents as in Figure 8 below: 02 at RAM location 08. Now, you are ready to run the CPU. Figure 8 j) To start running the CPU, you must be in Simulation Mode. Click the Hand icon (i.e. Change values within circuit) as shown in Figure 9 to go into the Simulation Mode. 15

Click the hand icon to start doing the simulation Figure 9 k) Double-click the RESET input once as shown in Figure 10. This will apply a pulse (i.e 1-0) to the RESET input pin. This will clear the PC register (i.e. PC 00) and place the CPU in the T0 state. Double-click the RESET pin of CPU once. Figure 10 16

Note: At any time you want to restart the program execution (i.e. reset the PC to 00 and place the CPU at T0), double-click the RESET pin once. l) Then, look at the sequence of micro-operations in Table 1B for instruction load address. It ends at T7. m) You must now advance the clock to completely execute instruction load address. This is done by double-clicking the CLOCK input of CPU 7 times (i.e. apply 1-0 seven times). n) Then, check the content of ACC register. This is done by double-clicking the CPU block as shown in Figure 10A: Figure 10A Double-click the CPU. o) This will enter the CPU internals as shown in Figure 10B. Then, double-click the ACC block to see the content of the ACC register. 17

Double-click the ACC. Figure 10B p) After the ACC is double-clicked, we can see an 8-bit ACC register as shown in Figure 10C. In this diagram, the value shown in the ACC register is 00. 18

The 8-bit content of ACC register is shown here. Figure 10C Question 2A: What is the content of ACC register after the instruction load 08 is executed? Write your answer in page 3 of your report. 19

q) At any time, you can check and confirm, at which T state your CPU is currently in by double-clicking the CPU block such as shown in Figure 10A. The CPU block diagram will be shown as Figure 11A. In the diagram, look at the SHIFT REG. At the bottom of SHIFT REG, there are pins labelled 14 through 0. Pin 14 is T0, pin 13 is T1,., pin 0 is T14. Then, look at the colour of those pins. In Figure 11A, the pin colour light green is at T14. Light green is logic 1, while dark green is logic 0. Since the light green is at pin 14, the CPU is in T0 state. If the light green is at pin 13, the CPU is in T1 state, etc. Pin 14 of SHIFT REG is coloured light green. So, the CPU is at T0 state. Figure 11A 20

You can go back to the COMPUTER view by double-clicking the COMPUTER item as shown in Figure 11B: Double-click the COMPUTER item. Figure 11B r) Then, look at the sequence of micro-operations for instruction subb you obtained in Question 1A. Question 2B: At what clock cycle T does instruction subb complete execution? Write your answer in page 3 of your report. 21

s) Depending on your answer in Question 2B above, if your instruction subb completes execution at TX, you have to apply a total of X+1 clock pulses (i.e. double-clicking the CLOCK input pin of CPU for X+1 times). For example, if the instruction subb finish at T8, then you must double-click the CLOCK input pin of CPU for 8+1 = 9 times as shown in Figure 11C below: Double-click the CLOCK input X+1 times. Figure 11C t) After double-clicking the CLOCK for X+1 times, check the content of the ACC register by following steps (n) (p) above. Question 2C: What is the content of ACC register after the instruction subb is executed? Write your answer in page 3 of your report. 22

Assignment Submission: You must submit a 4-page report. The report consists of: i. Front page containing title ECE514 Computer Organization Assignment No., your full name, your Student ID., your group, and date of submission. ii. Page 1- Answers for Questions 1A and 1B. (4 marks) iii. Page 2- Answer for Question 1C. (i.e. the screen capture of the completed Control Unit. (Refer to Appendix 2 on how to obtain the screen capture of Control Unit)). (4 marks) iv. Page 3 - The testing result of the CPU (i.e. Answers for Question 2A, 2B and 2C). (2 marks) Appendix 2 shows an example of the report. Submit your report at your lecturer s room latest by Friday 26 December 2014. Saiful Fadzli bin Salian (Room 7.27) Mohd Daud Alang Hassan (Room BA3.10) Ahmad Puad Ismail (Room BA2.7) THANK YOU 23

APPENDIX 1: SCREEN CAPTURE OF CONTROL UNIT Your circuit of your Control Unit might be huge. You may not able to Print Screen it by pressing the PrtScn button. Alternatively, you may obtain the screen capture image of the Control Unit circuit by using the Logisim built-in utility as explained below. a) Go to CONTROL UNIT view by double-clicking the Control Unit text in the project pane as shown in Figure A2(a). Double-click CONTROL UNIT Figure A2(a) 24

b) From the Logisim menu, click File Export Image as shown in Figure A2(b). Click Export Image Figure A2(b) c) An Export Image dialog box pops-up as shown in Figure A2(c) below. Leave the default. Just click OK. 25

Figure A2(c) d) A Select Export File dialog box appear as shown in Figure A2(d). Choose the directory location and filename of your choice to save the Control Unit image. 26

Figure A2(d) e) Paste the image inside your report. Resize it accordingly so that the text is clearly seen. 27

APPENDIX 2: REPORT EXAMPLE ECE514 COMPUTER ORGANIZATION ASSIGNMENT NO. NAME STUDENT ID. GROUP DATE OF SUBMISSION 28

ANSWER TO QUESTION 1A: SEQUENCE OF MICRO-OPERATIONS OF INSTRUCTION Clock Cycles T4 T5 : : : Activated Control Signals ANSWER TO QUESTION 1B: BOOLEAN EQUATIONS OF THE LISTED CONTROL SIGNALS: a = b = c = d = e = f = g = h = i = j = k = l = m = read = write = sel0 = sel1 = reset = 29

ANSWER TO QUESTION 1C: CONTROL UNIT CIRCUIT 30

QUESTION 2A: What is the content of ACC register after the instruction load 08 is executed? Answer: QUESTION 2B: At what clock cycle T does instruction subb complete execution? Answer: QUESTION 2C: What is the content of ACC register after the instruction subb is executed? Answer: 31

Sequence of Micro-Operations & Boolean Equations Correctly listed the sequence of microoperations in Question 1A and write correct Boolean equations in Question 1B. Control Unit Circuit Correctly create the circuit of Control Unit based on the above Boolean expressions using Logisim. (Question APPENDIX 3 ECE514 ASSIGNMENT RUBRIC Criteria 0 Mark 1 Mark 2 Marks 3 Marks 4 Marks Did not write any More than 2 2 incorrect Only 1 incorrect Boolean equation incorrect sequence sequence of microoperations, sequence of micro- and sequence of of micro-operations, OR operations, OR micro-operations in OR page 1 of report. 1C) CPU Testing Testing correctly the CPU by correctly answering the given questions (i.e. Questions 2A 2C) in CPU Testing section. Did not put any screen capture of the Control Unit circuit from Logisim in page 2 of report. Incorrect / Did not answer any Questions 2A 2C in CPU Testing section. More than 6 incorrect Boolean equations More than 6 incorrect control signal circuit. Correct answer for either Questions 2A OR Questions 2C. 4 6 incorrect Boolean expressions 4 6 incorrect control signal circuit. Correct answer for all Questions 2A 2C. 1 3 incorrect Boolean expressions 1 3 incorrect control signal circuit. Correct writing of all sequence of microoperations AND all Boolean equations. Correct circuit for all control signals. - - 32