Tutorial 8
Tutorial 8
1. Calculate the address lines required for an 8K-byte (1024 x 8 = 8192 memory word)
memory chip.
3. Specify the number of registers and memory cells in a 128 x 4 memory chip.
In a 128 x 4 memory chip, "128 x 4" means that it has 128 memory locations and
each location is 4 bits wide. The number of registers in the chip would depend on the
architecture and design, so we cannot determine that from the given information.
However, the number of memory cells can be calculated by multiplying the number
of memory locations by the word size:
5. If the memory chip size is 256 x 1 bits, how many chips are required to make up 1K
(1024) bytes of memory?
If the memory chip size is 256 x 1 bits, we need to determine the number of chips
required to make up 1K (1024) bytes of memory. Each chip has 256 memory
locations, and each location is 1 bit wide. To calculate the number of chips required:
Number of chips = (Required memory size in bits) / (Number of memory locations *
Word size) = 1024 / (256 * 1) = 1024 / 256 = 4 chips
Therefore, 4 chips are required to make up 1K (1024) bytes of memory.
6. If the memory chip size is 1024 x 4 bits, how many chips are required to make up 2K
(2048) bytes of memory?
If the memory chip size is 1024 x 4 bits, we need to determine the number of chips
required to make up 2K (2048) bytes of memory. Each chip has 1024 memory
locations, and each location is 4 bits wide. To calculate the number of chips required:
Number of chips = (Required memory size in bits) / (Number of memory locations *
Word size)
= 2048 / (1024 * 4)
= 2048 / 4096
= 0.5 chips
Since we cannot have half a chip, we need to round it up to the nearest whole
number. Therefore, 1 chip is required to make up 2K (2048) bytes of memory.
Answer:
(C) a set of memory locations in R/WM reserved for storing information temporarily
during the execution of a program.
Answer:
(A) a 16-bit register in the microprocessor that indicates the beginning of the stack
memory.
9. Check the appropriate answer in the following statements:
When a subroutine is called, the address of the instruction following the CALL
instruction is stored in/on the
(A) stack pointer.
(B) accumulator.
(C) program counter.
(D) stack.
Answer:
(C) program counter.
Answer:
(B) the memory address of the RET instruction is transferred to the program counter.
Answer:
(B) two data bytes at the top of the stack are transferred to the HL register pair.
12. Read the following program and answer the questions given below:
a) What address the programmer should initialize the stack pointer in Line 1?
The programmer should initialize the stack pointer in Line 1 with the value 0400H
since it represents the start of the available memory for execution.
b) What is the memory location of the stack where the first data byte will be stored?
The specific memory location of the stack where the first data byte will be stored
depends on the initial value of the stack pointer. Since the stack pointer is
initialized to 0400H, the first data byte will be stored at the memory location
03FFH (one address below the stack pointer).
c) Identify the Hex code and machine code for each instruction.
Line 5: PUSH H
Hex code: E5
Machine code: 1110 0101
Line 6: PUSH B
Hex code: C5
Machine code: 1100 0101
Line 7: MOV A, L
Hex code: 7D
Machine code: 0111 1101
Line 8: POP H
Hex code: E1
Machine code: 1110 0001
d) List the program counter from the start of the execution until end of the program.
Illustrate the association of each program counter with the content in the
memory.
PC = 0100H: 31 00 04 (Line 1)
PC = 0103H: 01 55 20 (Line 2)
PC = 0106H: 21 FF 22 (Line 3)
PC = 0109H: 11 90 20 (Line 4)
PC = 010CH: E5 (Line 5)
PC = 010DH: C5 (Line 6)
PC = 010EH: 7D (Line 7)
PC = 010FH: E1 (Line 8)
e) List the stack pointer from the start of the execution until end of the program.
Illustrate the association of each stack pointer with the content in the memory.
SP = 0400H
Line 1: LXI SP,0400H
After the program execution, the final stack pointer is SP = 03FEH. The stack
pointer moves down the memory locations as items are pushed onto the stack
and moves up as items are popped off the stack.
f) Illustrate the content of accumulator and register array for each instruction when
it is executed.
Content of the accumulator and register array for each instruction when
executed: