instruction inM reset Mux16 с reset bit -ALU output- Minput- A register A register output D register Mux16 с -ALU output
Posted: Tue May 24, 2022 8:22 am
what you answering was for different question, this is different.
PLEASE just don't copy and paste from previous question, this is a
question for division and table starts from #13, not #10. I dont
want to be rude, but this is post on answers for 10 times, you guys
have answered this wrong every single time. 1.
1.Consider the Hack computer block diagram shown in Figure 1
that you learnt during Week 8.
2. Imagine the Hack computer shown in Figure 1 is tasked with
executing the Hack assembly code shown in Figure 2. The objective
of this program is to implement integer division and store the
result. Specifically, it carries out the following operation: q =
n1/n2. It should be assumed that in all instances, n2 > 0.
3. Imagine that you are at the beginning of the LOOP (#11).
Assume that the values of n1 and n2 are 6 and 2. The variables n1,
n2, and q are stored at registers 16, 17, and 18, respectively.
4. Using your knowledge gained in the unit so far, complete the
Table 1 to show what occurs at each entity, at each line of the
code during this iteration. The first line is completed as an
example. Please also refer to the example video available in week 8
learning resources in the unit site (See Week 8 - Computer
Architecture > The Hack CPU https://d2l.deakin.edu.au/d2l/
le/content/1192510/viewContent/6000140/View), giving step by step
instructions on solving a similar exercise.
5. Create the given Table 1 in a Word document (or a similar
text editor) and then fill in the information for lines 13 - 23.
Hint: It may be useful to run this code in the CPU Emulator and
examine what happens at each step.
instruction inM reset Mux16 с reset bit -ALU output- Minput- A register A register output D register Mux16 с -ALU output- C's ALU memory address output- PC Figure 1: Hack Computer Program Counter output- outM writeM addressM PC
Code Line # (starting from 12) #12 #13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 Data Instruction Program Control/Address/ memory Memory Counter Data bus The The in- The data mem- ory is ac- cessed to read struction program memory input is set to address of #13 counter is set to PC++ ad- dress of #13 in- struction The control bits are sent to A register to load the value 16. The address of vari- able n1 is put into the address bus to access the memory location. The control bits are sent to the PC to in- crement its value by RAM[16] that stores the 1. value of nl Table 1: Line by line explanations A- D- M- register register Register The A- ΝΑ register is set to 16 ALU M reg- ΝΑ ister points to the memory that stores the vari- able nl, RAM[16]
#1 @RO //set RO #2 D=M #3 @nl #4 M=D// n1=RO #5 @R1 //set R1. Assume the value in Rl will always be>0 #6 D=M #7 @n2 #8 M=D// n2=R1 #9 @q # 10 M=0 // q- 0 //q nl/n2 #11 (LOOP) #12 @n1 #13 D=M #14 @n2 #15 D=D-M # 16 @FINISH #17 D; JLT # 18 @n1 # 19 M = D // n1 = nl-n2 #20 @q #21 M = M +1 #22 @LOOP #23 0; JMP #24 (FINISH)