Professional Documents
Culture Documents
Quiz 2a
Quiz 2a
Quiz 2a
Name: Solution
Student ID:
Section: 3A / 3B
A
Quiz 2 (6 November 2019) – 20 marks (CO2)
This is a closed book quiz. You can use calculator for this quiz. There are four questions for this quiz.
You have 15 minutes for the quiz.
The von Neumann Architecture uses only one memory block, and the memory holds
both the data and program. On the other hand, the Harvard Architecture uses two
memory blocks, one each for the data and program.
2) Answer the following short questions about the hardware architecture of the PIC18 MCUs:
a. What is the size of data bus of the PIC18 MCUs? [0.5 marks]
8 bits or 1 byte
b. What is the length (number of bits) of most instructions in PIC18? [0.5 marks]
16 bits or 2 bytes
EEEB 2044 / EEEB373 Microprocessor Systems
Semester 2 2019 / 2020
c. A PIC18 MCU uses 12-bit address to select its data memory. What is the size of the
data memory? Show your calculation. [1 mark]
d. A PIC18 MCU has a program memory size of 2 MB. What is the size (number of bits)
of the Program Counter (PC), which is used to access this program memory?
[1 mark]
e. The STATUS register contains the arithmetic status of the ALU. List the five flags /
bits contained in the STATUS register. [2.5 marks]
N – Negative bit
OV – Overflow bit
Z – Zero flag
3) The PIC18 MCUs implement the Access Bank to reduce the problem caused by bank switching.
a. What is the size of the Access Bank in PIC18F? [0.5 marks]
256 bytes
b. What are the ranges of the data memory accessible by the Access Bank without the
need to use the bank switching? [2 marks]
Access bank can access the lowest 96 bytes (0x00 to 0x5F) and the highest 160 bytes
(0xF60 to 0xFFF) of the data memory space.
4) Explain about instruction pipelining features in PIC18 and discuss its benefits. [3 marks]
PIC18 implements the Harvard architecture which uses separate memory blocks for program
and data. Separation of data memory and program memory enables simultaneous access to both
memory blocks and making instruction pipelining possible.
The PIC18 divides most instruction execution into two stages – the instruction fetch and
instruction execution. With instruction pipelining, up to two instructions are overlapped in one
particular cycle – one instruction is in fetch stage while the other instruction is in execution
stage during that same cycle. Because of pipelining, each instruction appears to take one
instruction cycle to complete, hence faster execution.