Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How would you extend the datapath in the Figure below to implement the LSL and L

ID: 3864520 • Letter: H

Question

How would you extend the datapath in the Figure below to implement the LSL and LSR instructions? Note: The ALU needs the first port to contain the value to shift and the second to contain the amount to shift by. Pay special attention to the data path for these values.

L PC Add Reg2Loc Branch Mem Read Instruction [31-21] MemtoReg Control ALUO MemWrite ALUSrc I RegWrite Instruction 19-51 Read Read nstruction [20-16] 0 register 1 Read address data 1 u Read register 2 nstruction [31-01 Write Read register data 2 nstruction nstruction 4-01 memory Write data Registers Instruction 131-0] 32 64 Sign extend Instruction [31-21] ALU Add result Shift eft 2 Zero ALU ALU r Read Address result data Write Data data memory ALU control

Explanation / Answer

Except for LSL and LSR, you can assume the shift amounts is 0 for all instructions. ADD (Extended Register, Immediate) ADDS (Extended Register, Immediate) CBNZ CBZ AND (Shifted Register) ANDS (Shifted Register) EOR (Shifted Register) ORR (Shifted Register) LDUR LDURB LDURH LSL (Register, Immediate) LSR (Register, Immediate) MOVZ STUR STURB STURH STURW SUB (Extended Register, Immediate) SUBS (Extended Register, Immediate) MUL SDIV UDIV HLT CMP BL BR B BEQ BNE BGT BLT BGE BLE   

1. ADD extended instruction format listed in the reference manual as below But if you compile ADD Xd, Xn, Xm, you will get a machine code bit_21 is 0. When you compile the format ADD Xd, Xn, Xm, <extend> <amount>, the bit_21 is 1. Please make sure ADD Xd, Xn, Xm can work with your simulator. The same thing happens in ADDS, SUB, and SUBS. 2. ADD extended instruction format is shown like this. In lab1, we don't expect you to implement {, <extend> {#<amount>}} part. You're only required to implement ADD Xd, Xn, Xm. ADDS, SUB, SUBS are the same. 3. For add function, though the reference manual use addWithCarry in the description, you don't need to implement addWithCarry. Simple add is fine. 4. For ADD immediate, defines as below No need to implement ReservedValue(). 5. For load/store, no need to do CheckSPAlignment().

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote