Computer Systems 2 Flashcards
Combinational circuits consit of?
- Logic gates connected together
- Has some inputs and produces some outputs
- Contains no feedback loops
- Outputs are a pure boolean function of the current input values
Procedure for Combinational circuit simulation
Find an output of a logic gate where all the inputs are known, and write down the output value (using the truth table for the logic gate)
Repeat until all signals are known
A multiplexor is a hardware version of?
The if-then-else expresson
mux1 c x y = if c is zero then x else y
What is a Clock Skew?
The clock ticks do not reach the flip flops at exactly the same time
A cicuit is synchronous if?
- It contains logic gates and flip flops
- Every flip flop is connected directly to a unique global clock
- No logic functions are performed on the clock signal
- Clock tick reaches each flip flop simultaneously
- Every feedback loop in the circuit passes through a flip flop
- The inputs to the circuit are assumed to remain stable throughout an entire clock cycle
Describe some behaviours of a synchronous circutit
- There is a single global state, comprising the states of all the flip flops in the entire circuit
- At each clock cycle, the circuit inputs and the flip flop outputs go into the combinational logic, which settles down in order to provide new inputs to the flip flops
A synchronous circuit is a sequential circuit that is designed so that…
All flip flops change their state at the same point in time
The synchronous design is a tradeoff, Explain..
- The designer gives up the ability to use some design techniques that may offer better speed
- In return, the behaviour of the circuit is much easier to reason about, especially for large and complex circuits
Describe some benefits of the synchronous model
- Entire circuit behaves as a single finite state automaton
- Simulate its behaviour with a simulation table
- It is not necessary to consider intermediate signal values in the combinational logic
- Temporary changing signal values (due to gate delays) can be ignored
When to use a combinational circuit?
- For pure mathematical functions (as long as they aren’t too complicated)algebra
- For computations that can be performed within one clock cycle
When to use a sequential circuit?
- For algorithms that require iteration
- For functions that would require too much time for one clock cycle
Describe some techniques for combinational design
- Specification as a boolean expression
- Synthesis from truth table
- Use multiplexor for conditional expression
- Describe the value you want on a signal, then introduce a building block to calculate it
Describe some technieques for sequential design
- Think of the states you want the machine to go through
- Introduce flip flops or registers to hold the state
- Describe the values you want to put into the flip flops or registers
- Design combinational circuits to calculate those values
Describe some characteristics of Sigma 16
- RISC style
- 16 - Bit words
- 16 bit memory address
- Instruction fields are 4 bits wide
- Instructions can be one or two words
One word instructions in Sigma 16 are?
RRR instructions
add R1,R2,R3
sub R1,R2,R3
etc
Two word instructions in Sigma 16 are?
RX instructions
lea R1,const[R2]
jumpf R1,const[R2]
etc
In Sigma 16 the pc register..
program counter: address of the next instruction
In sigma 16 the ir register….
instruction register: the instruction currently being executed
In sigma 16 the adr register…
address register: for calculating the effective address
In sigma 16 the dat register…
data register; used as buffer for the memory
In sigma 16 the trap instruction…
- Has three register operands (it’s an RRR instruction)
- The first register contains a trap code that tells the operating system what the program is requesting
- The other registers may contain further data
Describe the Control circuit…
- The circuit outputs a set of control signals
- The behaviour of the datapath is determiend by the values of the control signals
- The control circuit needs to examine a small number of signals within the datapath, in order to figure out what to do
- Therefore each circuit recevies inputs from the other, and sends outputs to the other
The instuction set architecture ISA defines…
- The registers and memory which are visible to the programmer
- The set of instructions
- How the instructions are represented (as words of bits)
- The effect of executing each type of instruction
In translating pseduocode to assembly language,
Describe statement-by-statement…
- Each statement is compiled independently
- Straightforward but inefficient
- Use this style if you feel confused
In translating pseudocode to assembly,
Describe register-variable style
- More efficient, but you have to keep track of whether variables are in memory or a register
- Real compilers use this style
- Use this style if you like the shorter code it produces
Describe some characteristics of statement-by-statment
- Each statement is compiled into a separate block of code
- Each statement requires loads, computation, then stores
- A variable may appear in several different registers
- There may be a lot of redundant loading and storing
- The object code corresponds straightforwardly to the source code, but it
- May be unnecessarily long
Describe some charactersitcs of register-variable style
- The instructions corresponding to the statements are mixed together
- Some statements are executed entirely in the registers
- A variable is kept in the same register across many statements
- The use of loads and stores is minimised
- The object code is concise, but it’s harder to see how it corresponds to the source code
Describe basic Memory Allocation
- The operating system maintains a map of the entire memory, organised as a set of blocks
- A running program often needs to allocate a block of memory dynamically
- When a program requests memory, it asks for a block of the size that it needs, and the operating system returns with the address of a block