Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Homework Solution: Contributions of von Neumann & Turing in Computer Architecture, Study Guides, Projects, Research of Architecture

Solutions to Problem 1 and 2 from the homework assignment of ELEC 5200-001/6200-001 (Spring 2017) course. The problems discuss the contributions of John von Neumann and Alan Turing to modern computer architecture, specifically their noteworthy inventions: the stored-program computer and the Turing machine.

Typology: Study Guides, Projects, Research

2021/2022

Uploaded on 08/01/2022

fioh_ji
fioh_ji 🇰🇼

4.5

(65)

824 documents

1 / 6

Toggle sidebar

Related documents


Partial preview of the text

Download Homework Solution: Contributions of von Neumann & Turing in Computer Architecture and more Study Guides, Projects, Research Architecture in PDF only on Docsity! ELEC 5200-001/6200-001 (Spring 2017) Homework 1 Solution Problem 1: John von Neumann and Alan M. Turing are deemed to have the most influence on the modern computer architecture. Identify one contribution from each that you consider most significant. In your opinion, which one of these two individuals had greater impact on the development of computer? Answer: Von Neumann’s stored program computer and Turing’s Turing machine are noteworthy contributions. Rest is a matter of opinion (you could argue the other way): Von Neumann had most impact on computing. Many early pioneers who actually built working computers had gained from his wisdom and ideas documented in a 1946 report, “Preliminary Discussion of the Logical Design of an Electronic Computing Instrument,” by A. W. Burks, H. H. Goldstine and J. von Neumann. Problem 2: What are Harvard and von Neumann architectures? Which is generally preferred and why? Answer: Harvard architecture uses separate memories for program and data. Stored- program architecture holds the program and data in a single memory. The single memory architecture is preferred perhaps due to its simplicity, economy, flexibility and convenience with respect to hardware and software. Problem 3: Which specific IAS and MIPS instructions require memory access? What is the percentage of such instructions in each instruction set? Compare the two instruction sets for their effectiveness in dealing with von Neumann bottleneck. Answer: The IAS computer has 21 instructions. Following instructions in IAS do not require memory data access: LOAD MQ loads data into AC register from MQ register LSH 1-bit left shift AC RSH 1-bit right shift AC Of a total of 21 instructions, three do not access memory. For MIPS, see Appendix in the textbook. Without counting pseudoinstructions, there are 133 instructions. Of those 17 (lb, lbu, lh, lhu, lw, lwc1, lw1, lwr, ll, sb, sh, sw, swc1, sdc1, swl, swr, sc) require memory access. The required data for the two instruction sets is tabulated below: Instruction set Total number of Instructions Instructions with memory data access Number of instructions Percentage IAS 21 18 85.7% MIPS 133 17 12.8% In general, a memory is a slower device than the processor. Any time a processor accesses memory it must slow down. This phenomenon forces a fast processor to run close to the speed of a slower memory and hence limits the performance is referred to as the von Neumann bottleneck. The percentage of MIPS instructions contributing to memory traffic is 12.8% while that for IAS is 85.7%. Hence MIPS is a superior instruction set. Problem 4: In the following assembly code written for the IAS computer, each word contains either a 40-bit constant or two 20-bit (left-L and right-R) instructions. The data contains three 100-word integer arrays, A(I), B(I) and C(I), starting at memory locations 101, 201 and 301, respectively. Memory address Instruction Comment 0 99 Constant N, initialized to 99 1 1 Constant, set to 1 2 100 Constant, set to 100 3L LOAD M(200) Transfer A(100) from Memory address 200 to AC 3R ADD M(300) Place A(100) + [B(100) from Memory address 300] in AC 4L STOR M(400) Transfer AC to C(100) at Memory address 400 4R LOAD M(0) Load N in AC 5L SUB M(1) Decrement N in AC by 1 5R JUMP + M(6, 20:39) Test N, if N ≥ 0, jump to 6R to continue 6L HALT Halt otherwise 6R STOR M(0) Update N in Memory address 0 7L ADD M(1) Increment AC by 1 7R ADD M(2) 8L STOR M(3, 8:19) Modify memory address in 3L 8R ADD M(2) 9L STOR M(3, 28:39) Modify memory address in 3R 9R ADD M(2) 10L STOR M(4, 8:19) Modify memory address in 4L 10R JUMP M(3, 0:19) Examine the assembly code and determine what result it produces. Answer: Initially, Problem 8: The following pseudoinstruction exchanges the existing values of the two argument registers: swap $r1, $r2 How should a MIPS assembler translate it into a set of real instructions? Answer: An assembler will implement the pseudoinstruction as follows: add $at, $r1, $0 add $r1, $r2, $0 add $r2, $at, $0 Problem 9: a. Add comments to the following MIPS subroutine code. Assume that argument registers $a0 and $a1 initially contain positive integers a and b, respectively. Assume that $v0 is used for the result. add $t0, $0, $0 loop beq $a1, $0, exit add $t0, $t0, $a0 addi $a1, $a1, – 1 j loop exit add $v0, $t0, $0 jr $ra b. What does this code compute? Answer: a. Commented code is as follows: add $t0, $0, $0 # initialize $t0 = 0 loop beq $a1, $0, exit # go to “exit” when $a1 is 0 add $t0, $t0, $a0 # compute $t0 = $t0 + $a0 addi $a1, $a1, – 1 # decrease $a1 by 1 j loop # repeat from “loop” exit add $v0, $t0, $0 # transfer $t0 to $v0 jr $ra # return $v0 = a * b b. The program computes a × b. Problem 10: A program uses registers 16 through 25. It calls a procedure. Write the instructions that compiler should include in the program before and after the call. Answer: Registers 16 through 23 are saved registers and by convention will be left unchanged by the procedure. Registers 24 and 25 are temporaries and must be saved prior to the call and restored after return. Following instructions are added by compiler surrounding the jal instruction that calls the procedure: addi $sp, $sp, – 8 # push stack pointer down two words sw $24, 4($sp) # save $24 in memory sw $25, 0($sp) # save $25 in memory jal procedure # $ra = PC + 4, PC = memory address of procedure lw $25, 0($sp) # restore $25 from memory lw $24, 4($sp) # restore $24 from memory addi $sp, $sp, 8 # bring stack pointer to original value
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved