You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
537 B

3 years ago
def Imm_gen(inst_code):
test=inst_code[25:32]
if test=='0010011':
imm_out=20*inst_code[0]+inst_code[0:12]
elif test=='0000011':
pass
elif test=='0100011':
pass
elif test=='1100011':
pass
elif test=='1101111':
pass
elif test=='1100111':
pass
elif test=='0110111':
pass
def imm_gen(inst_code,imm_out):
test=inst_code[25:32]
if test=="0010011":
imm_out=inst_code[0]*20+inst_code[0:12]
else:
imm_out='0'*32
return imm_out