For today's class, we will work in small groups (two or three). One of you, open a blank notebook, and the others should close their laptops. We will trade-off typing as we go.
Three representations of signed integers:
Q1: What is unusual about two of the columns? There is a number there that you don't usually see.
Q2: What is 11111 + 01111 ?
Q3: What is 10000 + 01111 ?
Q4: Work out by hand: What is 10001 + 01111 ?
Q5: Work out by hand: What is the two's complement for -13?
Q6: Work out by hand: What is the two's complement for -57 ?
Q7: Using the LC-3, compute the following:
NOTE: All binary will be in two's complement.
Q8: Work out by hand: convert 01000 to decimal
Q9: Work out by hand: convert 11000 to decimal
Q10: Work out by hand: convert 11111 to decimal
Q11: Work out by hand: convert 111111111 to decimal
Q12: Work out by hand: convert 000001000 to decimal
Q13: Convert decimal 105 to binary
Q14: Convert decimal -105 to binary
Q15: convert decimal 99 to binary
Q16: convert decimal -14 to binary
Explore the patterns of adding any two numbers to itself. Try positive and negative numbers.
Q17: Do you see a pattern? Describe it.
Two new instructions:
Bitwise AND and NOT (16 bits each):
AND: 0101 DST SRC 1 VVVVV NOT: 1001 DST SRC 111111
Q18: Write out the truth tables for AND and NOT.
Q19: Write out the truth tables for OR and XOR
Q20: Try out the AND and NOT instructions on the LC-3. Do they work as described?