CSE 331/EEE453: Microprocessor Interfacing and Embedded Systems
Assignment#2
Spring 2024
Name: ___________________________________
Student ID: ___________________________
irection: You can consultanyresourcessuchasbooks,onlinereferences,andvideos
D
for this assignment, however, you have to properly cite and paraphrase your answers
whenitisnecessary.Therewillbepointsforpartialattempts.Youcanuploadatypedor
handwritten copy of your assignment to the canvas. However, you have to show the
originalcopyofyourassignmentincaseofarisingquestionsabouttheauthenticity.You
should upload your assignment to canvas. There will bethreedaysofgraceperiodfor
late submission, however, 20% of points will be deducted.
ubmission guidelines: Allourassignmentswillbebasedon100pointssothatwecan
S
assignweightstogetyourpointsforfinalgrade.Whoeverfailstosubmitwithinthetime
period assigned through NSU canvas but submit the assignment within the next three
days will be punished by 20% deduction of points (e.g. start with-20pointswithin100
points). The late submission willbeopenuntilsemesterthroughemailtoTAandCCto
the instructor. After the first 3 days of grace period, the deduction will be 30%.
ote:YouareallowedtouseonlyinstructionsimplementedbytheactualMIPShardware
N
providedintheCanvasreferences.Useassemblylanguageformatfromthereferencesor
the book. Note, base ten numbers are listed as normal (e.g. 23), binary numbers are
prefixedwith0borformatsuchasXX2 andhexadecimalnumbersareprefixedwith0xor
format such as XX16/XXHEX
Problem (10x10=100 points):Answer the following 10questions:
1. ( 10 points)Write an assembly code for the followingC code
int main (void)
{ int x=7; int y=3; int z=2;
int total=0;
total=x*y-z;
}
2. ( 10 points) What is pipelining? What do you thinkare the advantages of pipelining?
How many pipeline stages does ARM Cortex-M4 have? Why does it have XX stages of
pipeline?
3. ( 10 points)What is the purpose of a stack pointer(SP) and heap? Where is the address
of the stack pointer stored? When to use stack and heap, and why?
4. ( 10 points)If you are given a 128 bit microprocessor?How much memory can it
address? Why do most microcontrollers have 32 bit architecture rather than 128 bit?
5. ( 10 points)Assume that the general purpose register(GPR) of a CPU has 8 registers
mainly R1, R2..R8 and three pipeline stages. Write the instruction stages for the
instruction- SUB R7, R4, R3.
6. ( 10 points)Intel and AMD use IA64 architecture fortheir 64bit processors which are
CISC type. On the other hand, STMElectronics uses ARM architecture for their Cortex M
series processor which is RISC type. What are the differences between RISC and
CISC?
7. ( 10 points)What are the advantages of Harvard Architectureover Von Neumann
Architecture?
8. ( 10 points)In a 32bit processor, both instructionand data consist of 32 bits. Can an
instruction in memory (in binary format) look exactly like a data? Explain.
9. ( 10 points)ARM cortex has a barrel shifter connectedto Operand 2. Explain how it will
be used for the following instruction: SUBEQ a1,v7,r2,LSL #3
10.(10 points)Show one or multiple instructions thatcan perform a multiplication by 45.
You can’t use any multiplication instruction such as MUL. S/UMULL or MLA, S/UMLAL