Tuesday, 22 September 2015 Upcoming talk: Harnessing Bioinformatics - - PowerPoint PPT Presentation

tuesday 22 september 2015
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1

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

slide-2
SLIDE 2

Hexadecimal

Base 16: 16 characters used: 0, 1, 2, …, 9, A, B, C, D, E, F (for base 10 values 0, 1, …, 9, 10, 11, 12, 13, 14, 15) Example: 1AE3hex 1x163 + 10x162 + 14x161 + 3x160 = 4096 + 2560 + 224 + 3 = 6883dec Memorize the first 16 binary representations: 0000 = 0, 0001 = 1, …, 1001 = 9, 1010 = A, 1011 = B, 1100 = C, 1101 = D, 1110 = E, 1111 = F

slide-3
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
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
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
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
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

$t2 = 0000 1111 1100 0011 1111 1010 0111 1111 (= 264501887)