In: Computer Science
we are talking about the mc68000 microprocessor
a) Explain possible scenarios that would set the V bit of the Status Register in signed number arithmetic operations b) Name 3 Internal Bus and explain their usage and functionality in a microcontroller c) Explain how the displacement is calculated and how the PC gets updated when branching to a subroutine using BSR instruction d) Why do we use MOVEQ or ADDQ instead of MOVE or ADD instruction? (Explain with an example)
Ans a) Bit 1, known as the V bit, is basically the overflow bit . It is set if an operation results in arithmetic overflow in terms of 2's complement arithmetic which means when the result of an operation is too large or too small to be handled by the destination operand
Ans b)
1. ADDRESS BUS (A23–A1): It is a 23-bit, unidirectional, threestate bus,capable of addressing 16 Mbytes of data.
capable of addressing 16 Mbytes of data.
2. DATA BUS (D15–D0): It is a bidirectional, three-state bus used for general-purpose data path of 16 bits wide to transfer data of either word or byte length.
3. MEMORY BUS: It has got Bi-directional data transfer and uni-directional Address transfer
Ans c) Displacement whwich is also known as Offset is calculated in the following way:
First: check out how the BNE instruction uses the offset and what PC value uses to calculate the next PC value if the jump is taken.
So, if the BNE
instruction is located at
$FF1234
, the value of PC used as base for the offset
to be added to, is $FF1236
.
OTOH, the PC destination value is $FF12C0
, so
$FF1236 + offset = $FF12C0
. offset
will
be a positive value. You should have no problem figuring it
out.
Ans d) Move Q as the name suggests make the movement quicker.
The MOVE immediate instruction takes 8 cycles in byte and word modes. There are two memory reads, one for the instruction and one for the immediate value.
The MOVEQ instruction encodes the immediate value into the instruction op-code itself, so only takes 4 cycles and 1 memory read. It can only take a byte immediate value.
For ADD Q again it is a quick instruction and it uses a special instruction word format which can include constants represented as 3-bit binary numbers (the constants are limited to the range 1 to 8 decimal).