SHI inserts zeroes
immediate
multiplication of 2 toa go 2k
Halfof a word 16bits Thus youcanuse
16 toshifthalfof a word
Shifting leftby
32 0 Thisgivesanerror
onlab machines
Shiftsuse a modified E type
Stl Shiftingwithregisters
Srli insertszeroes
Topic V06 Srai Signextendswhileshifting
Logic Instructions
1
,12bits 7bits
, Logic Operations in RISC- V
V
we
shift left logical immediate
target registorsourceregister 24 = lb
slli t2, s0, 4 immediate value 16
leftby4
bAyffltshifting
s0 0x0000000 = 210 Was 2 wehavemultipliedthe
bit 1 is 1 lb
0 2 210
Allee
number
by 24
arelostinshifting I u
sO 00000000000000000000000000000010 2 x 16 = 32
am
0 010 32 immediate
31 15 0
moved AM value 4
bythe 5
t 2 000000000000000000000000000000100
00,0 2 = 32
jam
8
000
2 OHHH
its 32 q
bit 5 is 1 bito
32
Me
2
immediate
multiplication of 2 toa go 2k
Halfof a word 16bits Thus youcanuse
16 toshifthalfof a word
Shifting leftby
32 0 Thisgivesanerror
onlab machines
Shiftsuse a modified E type
Stl Shiftingwithregisters
Srli insertszeroes
Topic V06 Srai Signextendswhileshifting
Logic Instructions
1
,12bits 7bits
, Logic Operations in RISC- V
V
we
shift left logical immediate
target registorsourceregister 24 = lb
slli t2, s0, 4 immediate value 16
leftby4
bAyffltshifting
s0 0x0000000 = 210 Was 2 wehavemultipliedthe
bit 1 is 1 lb
0 2 210
Allee
number
by 24
arelostinshifting I u
sO 00000000000000000000000000000010 2 x 16 = 32
am
0 010 32 immediate
31 15 0
moved AM value 4
bythe 5
t 2 000000000000000000000000000000100
00,0 2 = 32
jam
8
000
2 OHHH
its 32 q
bit 5 is 1 bito
32
Me
2