1. Consider the following Hack computer block diagram shown in Figure 1 that you learnt during Week 8 2. Imagine the Hac

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

1. Consider the following Hack computer block diagram shown in Figure 1 that you learnt during Week 8 2. Imagine the Hac

Post by answerhappygod »

1. Consider the following Hack computer block diagram shown in
Figure 1 that you learnt during Week 8
1 Consider The Following Hack Computer Block Diagram Shown In Figure 1 That You Learnt During Week 8 2 Imagine The Hac 1
1 Consider The Following Hack Computer Block Diagram Shown In Figure 1 That You Learnt During Week 8 2 Imagine The Hac 1 (43.56 KiB) Viewed 39 times
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.
1 Consider The Following Hack Computer Block Diagram Shown In Figure 1 That You Learnt During Week 8 2 Imagine The Hac 2
1 Consider The Following Hack Computer Block Diagram Shown In Figure 1 That You Learnt During Week 8 2 Imagine The Hac 2 (67.53 KiB) Viewed 39 times
1 Consider The Following Hack Computer Block Diagram Shown In Figure 1 That You Learnt During Week 8 2 Imagine The Hac 3
1 Consider The Following Hack Computer Block Diagram Shown In Figure 1 That You Learnt During Week 8 2 Imagine The Hac 3 (30.67 KiB) Viewed 39 times
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. Complete the Table 1 to show what occurs at each entity, at
each line of the code during this iteration
5. Create the given Table 1 in a Word document and then fill in
the information for lines 13 - 23
-ALU output ALU output C's Dregister instruction Mux16 A register outM ALU inM Mux16 input writeM A register output addressM memory address output reset reset bil- PC PC Program Counter output Figure 1: Hack Computer

Code Line # A- D- M- ALU Data Instruction Program Control/Address/ register register Register memory Memory Counter Data bus (starting from 12) #12 NA NA The A- register is set to 16 M reg- ister points to the memory that stores the vari- able nl, RAM[16] The data mem- ory is ac- cessed to read RAM[16] that stores the value of nl The in- struction memory input is set to address of #13 The program 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 nl 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 1. #13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 Table 1: Line by line explanations

#1 @RO //set RO DOM #2 43 @nl MED// nl-RO #4 @R1 //set Bl. Assume the value in B1 will always be>0 DM #5 #6 #7 #8 @n2 MED// n2-R2 #9 #10 eg M=0 // 4-0 #11 #12 #13 #14 #15 #16 //q - ni/n2 (LOOP) @ni DM @n2 DED-M @FINISH DEJT #17 418 @nl M = D// nl - nl-n2 #19 120 da M - M +1 #21 #22 #23 #24 LOOP OH JMP (FINISH) #25 #26 #27 (END) @END OHJMP Figure 2: Hack assembly code for integer division
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply