Question 0: Register Files

Slides:



Advertisements
Similar presentations
Goal: Write Programs in Assembly
Advertisements

Chapter 5 The LC-3 Instruction Set Architecture l ISA Overview l Operate instructions l Data Movement instructions l Control Instructions l LC-3 data path.
9-6 The Control Word Fig The selection variables for the datapath control the microoperations executed within datapath for any given clock pulse.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
LC-3 Computer LC-3 Instructions
Instructor: Yuzhuang Hu The Shifter 3 clock cycles will be needed if using a bidirectional shift register with parallel load.  A clock.
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Henry Hexmoor1 Chapter 10- Control units We introduced the basic structure of a control unit, and translated assembly instructions into a binary representation.
CPEN Digital System Design Chapter 9 – Computer Design
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 10 – Computer.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4: IT Students.
INSTRUCTION SET OF MICROPROCESSOR 8085
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4:
Topic 8: Data Transfer Instructions CSE 30: Computer Organization and Systems Programming Winter 2010 Prof. Ryan Kastner Dept. of Computer Science and.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Chapter 4 The Von Neumann Model
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 9 – Computer Design Basics Part 2 – A Simple.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 5 The LC-3 Instruction Set Architecture ISA Overview Operate instructions Data.
EKT221 ELECTRONICS DIGITAL II CHAPTER 4: Computer Design Basics
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
A Simple Computer Architecture Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Instructor: Yuzhuang Hu Midterm The midterm is schedule on June 17 th, 17:30-19:30 pm. It covers the following:  VHDL Programming. 
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA = All of the.
CoE3DJ4 Digital Systems Design
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 8.
EKT 221 : Chapter 4 Computer Design Basics
Our programmer needs to do this !
Ch. 10 Central Processing Unit Designs - CISC. Two CPU designs CISC –Non-pipelined datapath with a micro- programmed control unit RISC –Pipelined datapath.
Lecture 15: Pipelined Datapath Soon Tee Teoh CS 147.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
“ INSTRUCTIONS SET OF AVR MICROCONTROLLER ” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Abhishek Lakhara
Access the Instruction from Memory
Unit 1 Instruction set M.Brindha AP/EIE
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
Overview Part 1 – Datapaths Part 2 – A Simple Computer
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Chap 7. Register Transfers and Datapaths
Processor Instructions set. Learning Objectives
The LC-3 Instruction Set Architecture Data Movement instructions
Instruction set architectures
Computer Programming Machine and Assembly.
Today: Control Unit: A bit of review
Instruction set architectures
The all-important ALU The main job of a central processing unit is to “process,” or to perform computations....remember the ALU from way back when? We’ll.
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Two questions Four registers isn’t a lot. What if we need more storage? Who exactly decides which registers are read and written and which ALU function.
Multiplication by small constants (pp. 139 – 140)
Introduction to Micro Controllers & Embedded System Design
Unit 12 CPU Design & Programming
Enhancing Data Path M 4-bit Reg X A L U
Instruction set architectures
Datapath.
COMS 361 Computer Organization
Data manipulation instructions
Branch instructions We’ll implement branch instructions for the eight different conditions shown here. Bits 11-9 of the opcode field will indicate the.
COMS 361 Computer Organization
8-6 The Control Word The selection variables for the datapath control the microoperations executed within datapath for any given clock pulse Fig
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
Review: The whole processor
Example 1: (expression evaluation)
CS501 Advanced Computer Architecture
Immediate data Immediate operands : ADD r3, r3, #1 valid ADD r3, #1,#2 invalid ADD #3, r1,r2 invalid ADD r3, r2, #&FF ( to represent hexadecimal immediate.
Presentation transcript:

Question 0: Register Files Complete the register transfer operations listed below implemented by the given register file AA BA DA WR RD Operation 01 10 00 1 11 1 1

Answer Questions 1,2 and 3 using the following 16-bit Instruction Formats Opcode Operands Function ADD RD,RA,RB 0000000 RD RA RB R[DR]←R[SA]+R[SB] SUB RD,RA,RB 0000001 R[DR]←R[SA]-R[SB] DCR RD,RA 0000011 xxx R[DR]←R[SA] -1 INC RD,RA 0000010 R[DR]←R[SA] +1 AND RD,RA,RB 0001001 R[DR]←R[SA]  R[SB] OR RD,RA,RB 0001010 R[DR]←R[SA]  R[SB] MOV RD,RA 0000111 R[DR]←R[SA] ST RD,offset(RA) 1100000 Oper M[R[SA]+Oper] ← R[SB] LD RD,offset(RA) 1010000 Oper. R[DR]←M[R[SA]+Oper] LDI RD,operand 0110111 RD OperH OperL R[DR]←se || Operand ADI RD,RA,operand 0010000 RA Oper. R[DR]←R[SA] + se || Operand SUI.U RD,RA,operand 0010001 R[DR]←R[SA] - zf || Operand BZ offset 1110000 Address Offset If R[SA]=0 GOTO [PC+offset] BNZ offset 1110001 If R[SA]≠0 GOTO [PC+offset] JMP offset 1111000 GOTO [PC+offset]

Question 1 What is the range of numbers that can be used by the signed arithmetic operations (such as ADI R3,R2,N)? What is the range of numbers that can be used by the unsigned arithmetic operations (such as ADI.U R3,R2,N)? What is the range of numbers that can be loaded in a register using the LDI instruction? What is the range of numbers that can be loaded in a register using the LDI.U instruction? What is the maximum number of bits by a which a number can be shifted? What is the maximum forward displacement (Distance between current to next instruction) of a conditional branch instruction? What is the maximum backward displacement (Distance between current to next instruction) of a conditional branch instruction? What is the maximum size of data memory supported by the proposed ISA? Write a sequence of instructions that can implement the C-instructions “short int x=-101;” and “unsigned short int y = 132;”. Use register R0 as a data memory pointer initialized to the address 0x90, and that the address of x is 0x92 and the address of y is 0x95. Assume that the size of all registers and “short int” is 8 bits.

Q2. Determine the machine codes for the following program Assembly Opcode Operands Address m/c Codes LDI R2,26 0100 LDI R4,-18 ST R1,1(R2) L0: LD R3,2(R1) MOV R5,R2 SUB R4,R5,R2 BZ L2 L1 INC R4,R3 LD R2,3(R1) BNZ L3 BZ L1 L2: SUI R4,R2,3 INC R2,R4 ADD R4,R2,R2 JMP L0 L3: ST R1,2(R4)

Q3. Disassembly the following program Address m/c Code Opcode Operands Assembly 100 0EA8 L0: 102 06D0 L1: 104 E212 L2: 106 0170 L3: 108 E1F6 L4: 10A 23B3 L5: 10C 131A L6: 10E A023 L7: 110 0120 L8: 112 A063 L9: 114 0248 L10: 116 E3EE L11: 118 C062 L12: 11A F1E6 L13:

For the next three questions consider the following datapath

Control Word to Micro-operation Examples Determine the microoperation for the following control words: Control Word DA AA BA MB FS3..0 MD RW Micro-operation 6C11 E215 36A1 4801 D5C0 2143 3975 2545 3CDD

Micro-operation to Control Word Examples Determine the control word for the following microoperations: Micro-operation DA AA BA MB FS4..0 MD RW Control Word R1  R2 - R5 R6  DCR(R7) R4  R5 + 3 R1  R2 xor R3 R2  Data In=M[R5+2] M[R2+1]  Dout = R3 R3  LSL (R5,2) R2  -6 R6  R1-R4-Cy R5  - (R3)

Control Word to Micro-operation Examples Determine the microoperation and the content of the destination register location after the sequence of the following control words is applied to the datapath. Assume that the initial values of the registers and memory are as shown Assume also that the control words are applied sequentially on the datapath Reg. Data Addr. R0 3C 88 35 R1 24 89 65 R2 6A 8A A4 R3 58 8B 4C R4 8C R5 10 8D 33 R6 C9 8E 98 R7 1F 8F 1A 90 2C 91 F1 92 3E 93 50 94 3A 95 77 96 97 45 C.Word DA AA BA MB FS3..0 MD RW Micro-op. Result 0F01 5143 66E5 F1C0 B975 C605 E419