# CMPE12, Spring 2014, Section 01: Reading by week

For each week, I will list what part of the book we are addressing and what you should look into to prepare for the quiz on the following week.  Quiz topics often address the material from the week previous (depending on how things went in lecture). All chapter references are to Patt and Patel.

Week 1,2

Read Chapters 1, 3.  I realize much of 3 assumes you read 2 already.  Just muddle through, ask questions when you need to, and rest confident in the assurance we will get to everything.

### Problems (due to the TAs via email on Tuesday April 8):

1. Chapter 1: 2, 4, 15, 16, 17, 23
2. Chapter 3: 2, 4, 5, 6, 7, 9, 11, 13, 14, (15), 18abc(d), 20, 22, 23

(I'm not guaranteeing I will lecture on the topic of problem 15 or 18D in time for it to appear on the April 10 quiz.)

### Helpful web resources (always optional):

Kahn Academy on Counting in Binary (10.5 minutes).

Tutorial on Conversion between Binary and Hex.

Watch Vi Hart's Binary Hand Dance (2.5 minutes) (Silly, but your instructor finds it charming)

A previous MSI tutor wrote up an excellent description of CMOS transistors and how inverters work.

A good video on CMOS transistors at the low level.  More detail than you need for this class, but very easy to understand.

A good set of slides about implementing two-level circuits with NANDs only (or NORs only)

The Wikipedia page on Muxes (and demuxes). This one is pretty good with little animations and stuff.

The first quiz (April 3) will be on Binary, Decimal, Hexadecimal (and conversion between them) only.

The second quiz (April 10) will be on transistors, gates, and combinational circuits.

HOMEWORK 1 SOLUTIONS

April 3,10
Week 3

This week we are on the end of Chapter 3 and the start of Chapter 2.  We won't be doing any floating point yet, so stop there. Problems due to the TAs by the end of class on Tuesday, April 15 (tax day).

1. Chapter 3: 24, 27, 29, 31, 34
2. Chapter 2: 3, 4, 5, 8, 10, 11, 13, 15, 17, 18, 19, 20, 21, 25, 26, 27, 30, 33, 44, 46, 47, 48, 52

Optional Web resources:

Wikipedia on Carry Look Ahead adders. This is way more than you need for this class, but you might find it interesting.

Youtube video on SR latch. Websearches give me a ton of videos explaining RS NOR latches via minecraft, but I don't do minecraft so I am not equipped to judge.

This is a good intro to sequential circuits, but it goes into a bit more detail than we need. You probably want to pass over thing about timing and triggering for the moment.

Speaking of more than you need for this class, this intro to state diagrams and the design of counters is pretty good.  If you understand this you are WAY ahead of the game.  But it has pretty pictures and might be helpful.

Two's complement tutorial (read slowly! and checkout the description of overflow)

This intro to data representation and ascii might be helpful

### Homework 2 solutions.

April 17
Week 4

Read Chapters 4 and 5. Problems due to the TAs in email by midnight on April 22.

1. Chapter 4: 1, 2, 5 (ignore anything on floating point), 7, 9, 11
2. Chapter 5. 1, 2, 5, 7, 8, 12, 14, 17, 22, 25, 31 (the figure is on the same page, not the top of the next)

Optional Web Resources

If you were intrigued by Turing machines, the Wikipedia article is good.

They are very short, but you might like to look at the Wikipedia pages on the MAR and the MDR. If you are feeling especially advanced (but only then) you might like the page on Datapath--especially the part about the single buss organization. You might like to glance at the page on Data types--especially the machine data types.  Also very short, and possibly helpful is the page on load/store architecture.

Very short clear note on the memory interface.

I found the Howstuffworks page on computer memory to be pretty good.  You might want to stop around page 2.

It's probably a bit much right now, but as long as you don't get bogged down, the wikipedia page on the Instruction fetch execute cycle is good.

I did not assign patt and patel problem 4, but I wish I had.  If you understand it, that's a great sign.

Here is an LC-3 programming tutorial.

## Homework 3 solutions.

April 24
Week 5

We are continuing on in Chapters 4 and 5, but add in Chapter 7

Homework due via email April 29 at 11:59pm

1. Chapter 4: 12
2. Chapter 5: 4, 9, 10, 11, 15, 19, 22, 23, 30, 31, 32, 33, 34-39 (There is an error on 32.  See the appropriate forum comment.)
3. Chapter 7: 1, 2, 4

Optional Web Resources:

This site showing C and LC-3 comparisons is very helpful for understanding conditionals

## Homework 4 solutions.

May 1
Week 6

Chapters 6 and 8

This weeks homework comes from Chapters 6, 7, and 8 (due by 11:59 on Tuesday, May 6)

Chapter 6: 4, 8, 13, 15, 16

Chapter 7: 7, 10, 13, 17, 18, 20, 24

Chapter 8: 1, 2, 10, 11, 15

PDF from May Day Lecture about turning problem specifications into LC-3 code.

There are many sites that talk about using the LC-3 Simulator to debug.  Here is one.

## Homework 5 solutions.

May 8
Week 7

Chapter 9 and start reading Chapter 10.

This week's homework comes from Chapter 9, but the quiz could come anything related to LC3 programming and the Fetch-execute cycle (due by 11:59 pm on Tuesday, May 13) Oh.  It turns out exactly what the quiz is was discussed in class on Tuesday, May 13.

Chapter 9: 2, 4, 5, 6, 8, 13, 16, 18

## Homework 6 solutions.

May 15
Week 8

Chapter 10: 1, 2, 4, 6, 8, 11, 17, 20

(FYI, when 10.11 mentions Appendix A.3, they really mean A.4)

Additional problems (since the book doesn't talk about row-major and column-major and I want to put it on the Thursday quiz):

1. You have an array of integers with 24 rows and 30 columns, and the base address of the arry is 0x40FF
1. Using row-major ordering, what are the addresses of the array item at these index pairs:
[0,0], [5,5], [4,6], [6, 4] [23,29]?
2. Using column major ordering, what are the addresses of the same items?
2. Describe the difference between a stack and a queue. Why are queues not used to implement subroutine calls on the LC-3?
3. What is the difference between callee saves and caller saves as assembly procedure implementation conventions? Give examples where each would be superior.

## Homework 7 solutions

May 22
Week 9

Chapter 2

1. Read the Floating Point parts of Chapter 2.
2. Do Chapter 2 problems: 39, 40, 41, 52, 56.

## Homework 8 solutions

May 29
Week 10

More floating point and review

1. What is the Binary for 10.4?  What is the best possible IEEE floating point single precision for this number?
2. What is the Decimal for the IEEE floating point of
• 1 01111110 100 0000 0000 0000 0000 0000?
• 0 00000001 000 0000 0000 0000 0000 0000?
• 1 00000000 000 0000 0000 0000 0000 0000?
• 0 11111111 000 0000 0000 0000 0000 0000?
• 0 11111111 111 1111 1111 1111 1111 1111?
3. What is the next largest number than 218 representable in IEEE floating point single precision?  Give both the IEEE floating point and the decimal representation as a sum of powers of two.
4. What is the next largest integer than 218 representable in IEEE floating point single precision?  Give both the IEEE floating point and a decimal representation.
June 5