CS061 MIDTERM

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

how do you convert from two's comp binary to decimal?

1. flip all bits (take one's complement) 2. add one 3. interpret result as unsigned binary 4. convert that binary number to decimal 5. add negative sign if original two's comp number has 1 in left-most bit

how many transistors in a NOT gate

2

how many transistors in a NAND gate

4

how many transistors in a NOR gate

4

how many transistors in an AND gate

6

how many transistors in an OR gate

6

AND

AND R1, R2, R3 -performs bit wise AND on R2 and R3 and stores value in R1 -can use literal values in place of R3 only

LDR

LDR, R1, R2, #0 -R2 holds a label which contains a memory address as its value -R1 will hold the value that the memory address corresponds to

LEA

LEA R1, label1 -label holds a value, string, etc. -R1 stores the address of the label -R1 essentially becomes a pointer to a label

NOT

NOT R1, R1 -inverts the binary value of whatever value R1 holds -if R1 held 1, NOTing it would make R1 hold 0

ST

ST R1, label1 -stores what is in R1 in the label - (opposite of LD)

STI

STI R1, label1 -label1 holds a memory location as its value -STI stores what is in R1 in the memory address that the label holds

STR

STR R1, R2, #0 -stores what is in R1 in (R2 + 0) (R2 holds a memory address)

LDI

Same as LDR, but without an offset LDR, R1, R2 -R2 holds a label which contains a memory address as its value -R1 will hold the value that the memory address corresponds to

how do you convert from decimal to two's comp binary?

if negative: 1. take unsigned binary representation 2. invert (take one's complement) 3. add one if positive, two's complement representation will be the same as unsigned binary representation, with sign bit added

LD

loads a register with the value stored in a memory location denoted by a label (can only use it with labels)


Kaugnay na mga set ng pag-aaral

[ENGLISH 10] The Chipko Movement

View Set

American History- The Empire in Transition

View Set

"Pipelines, Platforms, and the New Rules of Strategy" Article

View Set