Professional Documents
Culture Documents
Review Problem Cap 2 PDF
Review Problem Cap 2 PDF
1. Write a assembly language program for the number sequencing computer that outputs the four
digit sequence 0,2,5,7 if LOC = 0, otherwise output the sequence 1,3,6,8. After a sequence is
finished, loop back to program start. Convert your assembly language program to machine code
starting at location 0.
Código ensamblador:
START:
JC SEC
OUT 0
OUT 2
OUT 5
OUT 7
SEC:
OUT 1
OUT 3
OUT 6
OUT 8
JMP START
2. Write the assembly language program corresponding to the NSC machine code program seen in
table 2.8
https://www.coursehero.com/file/97766775/Review-problem-cap-2pdf/
Codigo ensamblador:
START
OUT 0
JC 0
OUT 1
JC 0
OUT 2
JC 0
OUT 9
JMP START
3. For the NSC, assume that the LOC input is tied to the least significant bit of the DOUT bus. For the
program in Table 2.9, give the location executed and the DOUT value for the first 10 clock cycles.
https://www.coursehero.com/file/97766775/Review-problem-cap-2pdf/
Cycle Location Comment
1 0 OUT 2, DOUT = 2 = 0b0010 = Lsb = 0
2 1 OUT 4, DOUT = 4 = 0b0100 = Lsb = 0
3 2 JC 5, DOUT = 4 = 0b0100 = Lsb = 0
4 3 OUT 4, DOUT = 4 = 0b0100 = Lsb = 0
5 4 JC 0, DOUT = 4 = 0b0100 = Lsb = 0
6 5 OUT 9, DOUT = 9 = 0b0101 = Lsb = 1
7 6 JC 2, DOUT = 9 = 0b0101 = Lsb = 1
8 2 JC 5, DOUT = 9 = 0b1001 = Lsb = 1
9 5 OUT 9, DOUT = 9 = 0b0101 = Lsb = 1
10 6 JC2, DOUT = 9 = 0b0101 = Lsb = 1
5.Assume the number definition is changed to 1-X1X2X3-Y1Y2Y3-Z1Z2Z3Z4, with the local number
as Y1Y2Y3-Z1Z2Z3Z4. How many instructions are required for the NSC to implement this program?
Se necesitan de 12 instrucciones para realizar la NSC, desde el inicio, las instrucciones de salida, los
saltos condicionados y los saltos no condicionados.
6. Modify the schematic of the NSC (Figure 2.7) to add support for a new instruction called INC that
increments the current contents of the output register. Assign this new instruction the binary
opcode 11; the data field is unused. (Hint: Try replacing the output register with an up counter.)
7. Modify the schematic of the NSC (Figure 2.7) so that it can access a memory with 32 instructions.
(Hint: Begin by extending the memory to 32 locations, then trace all of the changes required in the
various components—you may be surprised at the number of modifications caused by this
seemingly minor extension.)
https://www.coursehero.com/file/97766775/Review-problem-cap-2pdf/
Es necesario aumentar la memoria de 16 a 32, por lo que el bus de direcciones de memoria aumenta
de 4 bits a 5. El tamaño de las instrucciones debe aumentar de 2 bits a 3.
8. Assume the NSC has a new instruction called INC (opcode = 11) that increments the contents of
the OUT register; the INC instruction data field is unused. Also assume that the LOC input is tied to
the complement of the DOUT[3] bit (LOC = ~DOUT3). For the program in Table 2.10, how many clock
cycles does it take to reach location 3?
9. What changes have to be made to the NSC (Figure 2.7) to accommodate a maximum of eight
instructions instead of four?
Es necesario incrementar los bits del opcode, porque también debe cambiar la memoria a 16x7, lo
que significa que cada ubicación e memoria tiene 7 bits.
https://www.coursehero.com/file/97766775/Review-problem-cap-2pdf/
Powered by TCPDF (www.tcpdf.org)