Documente Academic
Documente Profesional
Documente Cultură
i. What is the difference between General Purpose Registers (GPR) and Special Purpose
Registers (SPR)? GPR are for general use, user visible and needs to have address bits in
the machine code. SPR are special purpose, do not need explicit address bits and may
be user visible or not
ii. What is the difference between a floating point number and a fixed point number?
A floating number has an exponent part via which it floats whereas Fixed point as the name says is
fixed and no exponent
iv. If a microprocessor does not have an Accumulator register, can it still work?
Yes, it can use any of the general purpose registers but will need to use explicit address bits.
Principal: if one number is already big enough then any number added with the same sign will cause
an overflow e.g. to FFFF add any number (other than 0) and it will cause an overflow.
• -12345 and -54321 - Overflow
Page 1 of 7
Role # ____________________ Section TE-A TE-B TE-C TE-D CE
b. Convert following IEEE 754 double precision numbers to their equivalent decimal value. (7 points)
– This is a binary number represented using Hex.
• 40F0000000000000h
= 0100 0000 11110 (13*4 zeros) = 1.0 x 2100 0000 1111 - 1111111111 = 1 x 21000 = 65536
• 413F424000000000h
= 0100 0001 0011 1111 0100 0010 0100 (9*4 zeros) =
1. 1111 0100 0010 01 x 210000010011- 1111111111 = 1. 1111 0100 0010 01 x 210100 = (approx) 1.11 x 210100 =
(Approx) 1835008
c. Express the following numbers in IEEE 32 bit floating point format. (6 points)
Page 2 of 7
Role # ____________________ Section TE-A TE-B TE-C TE-D CE
00004100 = 00005100;
00004105 = 0000000A;
00004150 = 00000003;
00004200= 00000002;
00004206= 0000000A;
0000420D = 00000006;
00005100 = 00000006;
0000E100 = 00004100;
0000E106= 00004200;
R2= 00004105;
R3=00000005;
PC= 00004000;
SP = FFFFABCD;
FFFFABCD = 00000008;
Page 3 of 7
Role # ____________________ Section TE-A TE-B TE-C TE-D CE
Following table shows machine code for data move and add instructions of a microprocessor, the
only user visible SPR (Special Purpose Register) is Program Counter - PC:
ii. Does this follow orthogonality? If yes then how many mode bits and for what purpose (coding)
Yes, because op codes for all MOVE and ADD are the same. One Hex number is used for the mode
but that hex number is from 0-7. Therefore mode bits can be 3 or 4. In case of 3 mode bits the use is
for identification of Addressing Modes.
iii. How many GPRs (general purpose registers) does this microprocessor have?
The Machine code for any register instruction contains 01 for R1, 02 for R2 and so on therefore either
2 hex numbers are used for a GPR address or one hex. In case of one hex # of GPRS = 28
Page 4 of 7
Role # ____________________ Section TE-A TE-B TE-C TE-D CE
viii. In the above table entry 1, can you replace R1 with some SPR to increase directly accessible
memory?
Yes, PC (the only SPR available) can be used in the relative mode
a. Above table A1 shows 6 instructions and Table A2 shows data values for some locations,
please fill the following pipeline table B to execute these instructions. Please watch out for
the data dependency and if certain instruction do not need an stage then skip it i.e. if WO
stages is not needed then do not use it.
Page 5 of 7
Role # ____________________ Section TE-A TE-B TE-C TE-D CE
Page 6 of 7
Role # ____________________ Section TE-A TE-B TE-C TE-D CE
b.
No. Address Instruction Meaning JUMP
RESULT
I3 F002 ADD R3, R1, R2 R3 R1+R2
I4 F003 SUB R4,R1,R2 R4 R1-R2
I5 F004 JZ F002 Jump on Zero NOT TAKEN
I6 F005 ADD R5,R3,R4
I7 F006 JC FF03 Jump on carry TAKEN
I8 F007 SUB R6,R5,R1
I9 F009 JN FF05 Jump on TAKEN
Negative
I10 F00A MUL R7,R1,R2
I11 F00B JO FF07 Jump on NOT TAKEN
Overflow
I12 F00C JUMP F002 PC F002
I13 F00D STORE R7,(B100) R5 (B100)
Page 7 of 7