0% found this document useful (0 votes)
265 views6 pages

Review Problem Chap2

This document describes modifications made to the Number Sequence Computer (NSC) to increase its capabilities. It discusses adding a new "INC" instruction to increment the output register, expanding the memory from 16 to 32 locations, and modifying the NSC to support up to 8 instructions instead of the original 4. Key changes include increasing the size of the program counter, memory address bus, and instruction size to support the larger memory and opcode values needed.

Uploaded by

Juan Pablo Peña
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
265 views6 pages

Review Problem Chap2

This document describes modifications made to the Number Sequence Computer (NSC) to increase its capabilities. It discusses adding a new "INC" instruction to increment the output register, expanding the memory from 16 to 32 locations, and modifying the NSC to support up to 8 instructions instead of the original 4. Key changes include increasing the size of the program counter, memory address bus, and instruction size to support the larger memory and opcode values needed.

Uploaded by

Juan Pablo Peña
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

UNIVERSIDAD DE LOS LLANOS

MICROCONTROLADORES Y
Facultad de Ciencias básicas e ingenierías
MICROPROCESADORES
Programa ingeniería electrónica

REVIEW PROBLEM CHAP2

JUAN CARLOS GUTIERREZ PARRA

UNIVERSIDAD DE LOS LLANOS


FACULTAD DE CIENCIAS BASICAS E INGENIERIA
VILLAVICENCIO - META
2019
UNIVERSIDAD DE LOS LLANOS
MICROCONTROLADORES Y
Facultad de Ciencias básicas e ingenierías
MICROPROCESADORES
Programa ingeniería electrónica

1.) Write an 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.

LOCATION MACHINE CODE LABEL MNEMONIC


0 10111 START; JC LOC_IS_1
1 100000 OUT 0

START

1
LOC

Dout =1 Dout =0

Y1
Dout =2

Dout =5 Y2

Dout =7 Y3

Dout =3 Z1

Dout =6 Z2

Dout =8 Z3
UNIVERSIDAD DE LOS LLANOS
MICROCONTROLADORES Y
Facultad de Ciencias básicas e ingenierías
MICROPROCESADORES
Programa ingeniería electrónica

Memory location Machine Code Instruction


0x0 01 0110 START: JC LOCAL
0x1 10 0000 OUT 0
0x2 10 0010 OUT 2
0x3 10 0101 OUT 5
0x4 10 0111 OUT 7
0x5 01 0000 JMP START
0x6 10 0001 LOCAL OUT1
0x7 10 0011 OUT 3
0x8 110 0110 OUT 6
0x9 10 1000 OUT 8
0x10 00 0000 JMP START

START JC LOCAL

OUT 0

OUT 5

OUT 7

JMP START

LOCAL :

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.
3.) START:
4.) OUT0
5.) JC START:
6.) OUT 1 :
7.) JC START:
8.) OUT 2
9.) JC START:
UNIVERSIDAD DE LOS LLANOS
MICROCONTROLADORES Y
Facultad de Ciencias básicas e ingenierías
MICROPROCESADORES
Programa ingeniería electrónica

10.) OUT9
11.) 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.

CICLOS Location INSTRUCCIONES


1 0 Out 2, Dout2 =0b0010, LOC=0
2 1 Out 5, Dout5 =0b0101 LOC=1
3 2 JC 5 ,Dout 5= 0b0101 LOC=1
4 5 Out 9 , Dout 9= 0b1001 LOC=1
5 6 JC 2, Dout 9= 0b1001 LOC=1
6 2 JC 5, Dout9=0b1001 LOC=1
7 5 Out 9 , Dout 9= 0b1001 LOC=1
8 6 JC 2, Dout 9= 0b1001 LOC=1
9 2 JC 5, Dout9=0b1001 LOC=1
10 5 Out 9 , Dout 9= 0b1001 LOC=1

4. Repeat problem #3, except change the instruction at location #1 to OUT 4.

CICLO LOCACION INSTRUCCIÓN OUT OUT LOC


1 0 OUT=2 2 0b 0010 loc=0
2 1 OUT=4 4 0b 0100 1
3 2 JC=5 4 0b 0100 1
4 5 OUT=9 9 0b 1001 1
5 6 JC=2 9 0b 1002 1
6 2 JC=5 9 0b 1003 1
7 5 OUT=9 9 0b 1004 1
8 6 JC=2 9 0b 1005 1
9 7 JC=5 9 0b 1006 1
10 5 OUT=9 9 0b 1007 1
UNIVERSIDAD DE LOS LLANOS
MICROCONTROLADORES Y
Facultad de Ciencias básicas e ingenierías
MICROPROCESADORES
Programa ingeniería electrónica

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.

Start: JC LOCAL

OUT 1

OUT X1

OUT X2

OUT X3

LOCAL OUT Y1

OUT Y2

OUT Y3

OUT Z1

OUT Z2

OUT Z3

OUT Z4

JMP Start

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.)
UNIVERSIDAD DE LOS LLANOS
MICROCONTROLADORES Y
Facultad de Ciencias básicas e ingenierías
MICROPROCESADORES
Programa ingeniería electrónica

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.)

El primer cambio es aumentar el número de ubicaciones de memoria de 16 a 32. Esto hace que
el bus de dirección de memoria aumente de 4 bits (24 = 16) a 5 bits (25 = 32). Esto significa que
el contador de programas tiene que aumentar de 4 bits a 5 bits. Finalmente, el tamaño de las
instrucciones debe aumentar en un bit porque el campo de datos de instrucciones JC / JMP
especifica una ubicación, que ahora requiere 5 bits. Así que el nuevo tamaño de memoria es 32

9. What changes have to be made to the NSC (Figure 2.7) to accommodate a maximum of eight
instructions instead of four?

El campo de código de operación debe incrementarse de 2 bits a 3 bits; esto cambia la memoria
de memoria a 16 × 6 a una memoria de 16 × 7 (cada ubicación ahora contiene 7 bits)

You might also like