7 Feb 2013
Homework 3 -- CS 429 Spring 2013
We have covered Chapter 3 of B+O (Computer Systems: A Programmer's Perspective (2nd Edition),
Randal E. Bryant, David R. O'Hallaron, 2010), so these exercises are meant to check that you
understand basic instruction set architecture (ISA) issues.
Topics: memory, bus, cpu, ISA, shift/rotate, condition codes, machine state, interrupts
For the following binary numbers, compute even and odd parity:
- Assume I have a 32-bit word. If I want to detect a memory error
in that word, how many bits do I need? If I want to do single bit correction,
what is the minimum number of bits that I need? If we could come up with a
code that could detect and correct any two bits changing, what is the minimum
number of bits that I need?
- If I have in memory, starting at location 0x0200, the four bytes
0x00, 0x11, 0x22, 0x33, in that word, and I load them into a 32-bit register
as little-endian, what is the result? What is the result if I load them
- If I have an 18-bit physical address for a word-address machine,
how much memory can my architecture support? How about a 24-bit byte-address
- Name 4 types of wires/lines that would be on a bus connecting a
CPU and memory.
- What is the defining characteristic of a Von Neumann machine?
- Give the basic operation loop of a computer.
- What is PC? How big is it?
- Give an example of a special purpose register.
How does it vary from a general purpose register?
- If I have a 6-bit opcode field, how many different instructions
can I have? If two of those 6-bit opcodes indicate that there is another
6-bit secondary opcode, now how many instructions can I have?
- Give an example of a 1-address instruction. A 2-address
instruction. A 3-address instruction.
- For a 0-address instruction, where does an instruction find its
- What is the purpose of an index register?
- How does an "add immediate" instruction differ from an "add"
- For each of the following binary values, show the result
for a (a) left-shift by 3, (b) arithmetic shift right by 3,
(c) logical shift right by 3, (d) rotate left by 3, (e) rotate right by 3.
- For the binary value 0110100100101010,
if we had a 6-bit opcode, what would it be?
An 8-bit opcode? Would you expect it to be
represented in decimal, octal, hexadecimal, or binary?
- What mask would I use to select bits 4 to 7
(numbering bits from 31 (high order) down to 0 (low order)).
Represent it in both binary and hex.
- If we encode a conditional jump by 3 bits: leg
where l indicates to jump on less than zero, e indicates
to jump on equal to zero, and g indicates to jump on
greater than zero, what is the meaning of:
- What types of errors can a computer detect as
it is executing instructions?
- What is the essential difference between a vectored
interrupt and a non-vectored interrupt?