1 Verilog HW #8 Write an assembly program to calculate the sum of the ten scores stored in memory as shown on the right. Store the sum in the address 99.

Slides:



Advertisements
Similar presentations
Lecture 5: MIPS Instruction Set
Advertisements

Central Processing Unit
MIPS assembly. Review  Lat lecture, we learnt  addi,  and, andi, or, ori, xor, xori, nor,  beq, j, bne  An array is stored sequentially in the memory.
1 HW #6 Write an assembly program to calculate the sum of the ten scores stored in memory as shown on the right. You can use any instruction used in the.
CPS 101 Introduction to Computational Science Wensheng Shen Department of Computational Science SUNY Brockport.
Chapter 16 Control Unit Operation No HW problems on this chapter. It is important to understand this material on the architecture of computer control units,
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Stored Program Concept: The Hardware View
Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009
COMPUTER INSTRUCTIONS
Lecture 8 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
Lecture 3. Diff b/w RAM and Registers Registers are used to hold data immediately applicable to the operation at hand Registers are used to hold data.
Computer System Architecture ESGD2204
1 Basic Computer Organization & Design Computer Organization Computer Architectures Lab BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
CPU Design. Introduction – The CPU must perform three main tasks: Communication with memory – Fetching Instructions – Fetching and storing data Interpretation.
Exam2 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
Lec 5 Basic Computer Organization
17 - Jumps & Branches. The PC PC marks next location in Fetch, Decode, Execute cycle.
M. Mateen Yaqoob The University of Lahore Spring 2014
CSE 241 Computer Organization Lecture # 8 Ch. 7 Control Unit Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Lecture Set 4 Programming the 8051.
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
Computer Systems Organization
Computer Organization 1 Instruction Fetch and Execute.
1 Basic Computer Organization & Design Computer Organization Prof. H. Yoon BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers.
Instruction.
Ch5. 기본 컴퓨터의 구조와 설계.
8085 processor.
Processor Organization
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
Program to multiply 2 numbers 500-Input x 291-Store acc. as x 500-Input y 292-Store acc. as y 193-Load y in to acc. (0 on 1 st parse) 391-Add x to acc.
Basic Computer Organization - Part 2 Designing your first computer
Little Man Computer Task 1 Last lesson you were asked to write a program to multiply two numbers together. The next slide has a working program to do this.
1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference.
Instruction Memory value Description ADD1xx Add the value stored at memory address xx to the value in the accumulator register SUB2xx Subtract the value.
PROGRAMMING THE BASIC COMPUTER
PROGRAMMING THE BASIC COMPUTER
CSCI206 - Computer Organization & Programming
Symbol Hex Code Description I=0 I=1
PROGRAMMING THE BASIC COMPUTER
Lecture on Microcomputer
ADVANCED PROCESSOR ARCHITECTURE
Computer Organization and Design
BASIC COMPUTER ORGANIZATION AND DESIGN
INDEX UNIT-III PPT SLIDES
Design of the Control Unit for Single-Cycle Instruction Execution
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
Assembler CASE Tool.
PROGRAMMING THE BASIC COMPUTER
Computer Organization and ASSEMBLY LANGUAGE
Design of the Control Unit for One-cycle Instruction Execution
Instruction and Control II
Topic 6 LC-3.
CSCI206 - Computer Organization & Programming
Sequencing, Selection, and Loops in Machine Language
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Computer Architecture and Organization: L07: Control Sequence
PROGRAMMING THE BASIC COMPUTER
MARIE: An Introduction to a Simple Computer
CS Chapter 4 Dr. Clincy Professor of CS TODAY’S AGENDA
EECE.3170 Microprocessor Systems Design I
CS334: MIPS language _Mars simulator Lab 2_1
Instruction execution and ALU
EECE.3170 Microprocessor Systems Design I
Presentation transcript:

1 Verilog HW #8 Write an assembly program to calculate the sum of the ten scores stored in memory as shown on the right. Store the sum in the address 99. You can use any instruction used in the lecture slides but try to minimize your instruction set. If you need, you can make your own instruction such as LDC. But, remember that you have to implement it in your CPU eventually. LDC // Load constant number to AC ex) LDC 9 // AC <= 9 Calculate the total cycles to complete the program.

과제마감은 11 월 13 일 11 월 10 일에 자신의 어셈블리코드에 대한 발표를 하는 학생은 최대 30 점 보너스. 2

function call vs. goto main ( ) { for (i=0; i < 10; i++) add (&sum, score ); printf (“%d”, sum); } add (&sum, score ) { sum = sum + score[i]; } 3 main ( ) { i = 0; loop : sum = sum + score[i]; i = i + 1; if (i != 10) goto loop; printf (“%d”, sum); }

add 110 // AC <= AC + mem[110] add [110] // AC <= AC + mem[mem[110]] isz 100 // mem[100]= mem[100]+1 // if mem[100] == 0, skip next instruction, AND 0xxx 8xxxAND memory word to AC ADD 1xxx 9xxxAdd memory word to AC BUN 4xxx CxxxBranch unconditionally BSA 5xxx DxxxBranch and save return address ISZ 6xxx ExxxIncrement and skip if zero SymbolI = 0I = 1Description isz T4 ~ T6 : D 6 T 4 : DR <- M[AR] D 6 T 5 : DR <- DR +1 D 6 T 6 : M[AR] <- DR, if (DR = 0) then PC <- PC +1, SC <- 0