SLIDE 1
Tuesday, 22 September 2015 Upcoming talk: Harnessing Bioinformatics - - PowerPoint PPT Presentation
Tuesday, 22 September 2015 Upcoming talk: Harnessing Bioinformatics - - PowerPoint PPT Presentation
Tuesday, 22 September 2015 Upcoming talk: Harnessing Bioinformatics September 24 at 4:30 p.m. in Steffee B10 Questions about lab? Department coffee/tea TODAY at 2! Today: more on binary, hexadecimal, MIPS Hexadecimal Base 16: 16 characters
SLIDE 2
SLIDE 3
Hexadecimal
Memorize: For a signed (32-bit) integer, FFFFFFFFhex = -1dec For a signed (32-bit) integer, 8FFFFFFFhex = 2147483647dec In MARS, we can enter constants as either decimal or hex. For hex, use the prefix “0x”. Example: li $t0,0x1ae3 # loads hexadecimal 1ae3
SLIDE 4
Back to MIPS Instructions
Last time: R-format instructions: Example: add $t2,$zero, $t3 000000 00000 01011 01010 00000 100000 $zero $t3 $t2
- p
rs rt rd shamt funct
6 bits 6 bits 5 bits 5 bits 5 bits 5 bits
- pcode is 000000 for all R-type instructions
This means “add”
SLIDE 5
Back to MIPS Instructions
Example: sub $t0,$v0,$a2 000000 00010 00110 01000 00000 100010 $v0 $a2 $t0
- p
rs rt rd shamt funct
6 bits 6 bits 5 bits 5 bits 5 bits 5 bits
different from add
SLIDE 6
Back to MIPS Instructions
“AND” -- take the “and” of each pair of bits in the same position:
$t0 = 0000 1001 1000 0011 1111 1000 0101 1111 (= 159643743) $t1 = 0000 0111 0100 0011 1011 0010 0110 1001 (= 121877097)
and $t2,$t0,$t1 gives
$t2 = 0000 0001 0000 0011 1011 0000 0100 1001 (= 17018953)
SLIDE 7
Back to MIPS Instructions
“OR” -- take the “or” of each pair of bits in the same position:
$t0 = 0000 1001 1000 0011 1111 1000 0101 1111 (= 159643743) $t1 = 0000 0111 0100 0011 1011 0010 0110 1001 (= 121877097)
- r $t2,$t0,$t1 gives