Sheet 2 Answers
Sheet 2 Answers
Q2-1 : little endian: the lowest ordered byte is kept in the low-order bits of the
word.
big endian: the highest ordered byte is kept in the low-order bits of the word.
Q2-2 : Von Neumann: machine has shared program and data memory.
b) The purpose of the CPSR is to expose and record useful information about
the results
of the current arithmetic operation.
c) The Z bit indicates whether or not every bit of the result of the current
arithmetic
operation is 0.
Q2-4 : a) 2 - 3
b) - 2^32 + 1 - 1
c) - 4 + 5
c) MI : minus
d) VS : overflow
Q2-6 : the BL instruction is used to allow for subroutines. The BL instruction is much
like a
branch except, in addition to modifying the PC to point to its target, it also
stores the
current PC in R14
Ex. r14=r15+4
r15->r15 ± branch offset
Q2-7 : Move r14 to r15. So, executing the instruction : MOV r15,r14 will perform
the required
functionality.
Q2-10 : Yes
Q2-11 : 8 levels
Q2-17 : Data and program are mapped to the same physical memory.
- system (SSP)
Q2-23 : slow return: the return address and loop context are stored on the stack.
Q2-25 :
fetch packet : a unit of memory. it holds up to eight words and is aligned on 256-bit
boundaries
execute packet : a unit of execution. It defines the set of instructions that are
executed together
------------------------------------------------------------------------------------------------------------------------------------------
L2-1 :
A circular buffer stores recent input samples and automatically wraps around
when it reaches the end.
In the FIR filter, each new sample is added to the buffer, and the filter output is
calculated by multiplying buffer samples by filter coefficients and summing the
results.
This method efficiently handles continuous data streams without needing to shift
data.
int index = 0;
int output = 0;
buffer[index] = input;
int j = index;
index = (index + 1) % N;
return output;
L2-2 :
data[i] = i * 2;
ARM Cortex-M:
The general-purpose processor has a larger code size due to less specialized
instructions for DSP tasks.
TI C55x DSP:
The DSP processor has a smaller code size due to specialized instructions for
FIR filtering and loop unrolling.
Performance:
The TI C55x DSP is significantly faster, with 6.25x higher throughput and
6.25x fewer cycles compared to the ARM Cortex-M. The DSP processor is
optimized for tasks like FIR filtering
TI C55x DSP:
ARM Cortex-M: