General Compare and Contrast Sht Flashcards

1
Q

State the main difference between the von Neumann architechture and the Harvard architecture

A

The main difference is the harvard architecture has seperate memories for instructions and data and hence sereate busses to access these 2 memories, while a von Neuman architecture has a single memeory for storing both programs and data.

Advantage of Von Neumann:

  • Only on main memory and can be entirely used by a program
  • Having one bus leads to simpler and cost-effective control unit
  • Data and instructions are accessed in the same way

Advantage of Harvard

  • Two buses can theoretically lead to execution that is twice as fast
  • Memories for data and instruction can be of different technologies and siezes
  • Safe in the sense that a program cannot overwrite itself
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the general instruction cycle?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Compare/Contrast CISC vs RISC

A

CISC - Complex Instruction Set Computer

Large collection of instructions with lots of addressing modes

Primary Goal: use as few lines of assembly languages instructions as possible to complete a task

Advantage: makes translating from high-level languages to assembly easier

Disadvantage: only a very small subset of the instructions will be used in a typical program

RISC - Reduced instruction set computer

small collection of instructions with few adressing modes

Uses only simple instructions that can be in a single clock cycle

Advantage: pipelining can be used to improve performance (because each insrtruction requires one clock cycle)

Disadvantage: It’s more difficult to write code for, due to limited instruction set and addressing modes and assembly language programs tend to be longer than those written for a CISC architecture

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the following traps?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is done on each pass of the compiler?

A

First pass:

Symbol table created, used on the 2nd pass to “fill in” the label references

Second pass:

  • Each line scanned again
  • Translated assembly lang to machine lang
    • find the right opcode for the instruction
    • look up symbls in the symbol table as necessary
    • determine operand field for the instruction
  • Fill memory locs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the instructions that affect condition codes?

A

Add, And, ld, ldi, ldr, lea, not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between JMP and the various forms of branching?

A

JMP can go beyond the -255 to 256 distance from PC (ask compared to BR)

JMP can jump to anywhere in the memory space

Example:

LEA R4, EXIT

JMP R4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between combination and sequential circuits?

A

Combinational:

Circuits whose output dpeends only on the current inputs

Sequential:

circuits whose output depends on the current inputs and it’s current state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a decoder?

A

A n-bit decoder has n inputs and 2n outputs

Exactly one output is set to 1 for each input pattern

Think of n inputs as encoding an unsigned number j and kth output is 1 if and only if k = j

Useful for selecting or activating one of many components based on a bit pattern.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What would an encoder do with 3 inputs?

A

The 3 inputs would represent a 3 bit number.

The outputs would be labeled 0 through to 7 (the binary representations)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Create a decoder for this circuit:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a multiplexor and what is it used for?

A

Inputs:

n-bit selector S0,S1,…Sn-1

2n “data” inputs D0,D1,…D2n-1

Output:

one of the 2n inputs determined by the n-bit

If Sn-1Sn-2…S1S0 = k using unsigned encoding, then the output is the input value Dk

Uses:

select oninput from multiples

Select which computed value to pass to the next stage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the difference between a decoder and a multiplexer?

A

A decoder takes two bits and has 2^n out puts

We make an unsigned number with the selector bits and output the number that it represents

A multiplexor takes this concept but adds an additional input into the gate so that when the number is outputted the actual output is the 1/4 outputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between active high and active low?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an S-R latch and how does it work?

A

It is important that we do not set the latch to S=1 and R=1

It will just oscilate!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Provide the truth table for a S-R latch

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the different between an S-R Latch and a D latch

A

S-R latch:

Should never set R=1, S=1

D-latch:

Is an S-R latch with additional logic with a new input signal.

WE, outputs can be set/reset only when WE=1 (know as level sensitive)

The S-R inputs are replaced with a single input D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a D-latch and how does it work?

Provide the truth table

What is a problem with using D latches?

A

It’s an S-R latch with extra logic.

Inputs S-R are now replaced by WE and D as our input to let through or not let through

  • When E= 0, the latch holds its current value
  • When E=1, the output of the 2 AND gates depends on D
    • When D=1 it has the effect of S=1, R=0
    • When D=0 it has the effect of S=0, R=1

Problem:

If we have a sequence of D lathces where the output of one latch is used as input for another latch and they all share a common E (enable) input signal

If a clock used as E input signal, the input value going into the first latch can get propagated to other latches if the clock holds its value at 1 for too long of a duration

This is a real problem in when the system is synchronous, like a CPU

19
Q

What is:

  • Address Space
A

Address Space:

  • is the adressable locations of the memory
  • Given an n-bit address, 2n distinct addresses may be specificied
    • If each location holds 1 byte (= 8 bits) than the mem size is 16mb
    • Ieach locations holds 4 bytes (= 32 bits) than the mem size is 64mb
  • A word is the size of a quantitity that is processed by the ALU
20
Q

What is addressibility?

A
  • Computers are either byte or word addressable
  • Each memory location holds either 8 bits (1 byte) or a full standard word for that computer
  • In computers a whole word is written to and read from memory in one oepration, even if comp is byte-addressable
    Endian
21
Q

What is endian?

A

Specififies how a (multi-byte) word is stored in a byte-addressable computer
Two possibilities:

  • Big endian - The MSB of the word is stored at the specificed address
  • Little endian - The LSB of the wor is stored at the specified address
22
Q

What are the attributes a FSM has?

A

A finite state machine state transition are only possible on positive clock edges

23
Q

What are the general steps to building a circuit for a FSM?

A
24
Q

What building a FSM circuit

What do we make from the truth table?

What do we make from the state transition table?

A

Truth table = outputs

Statetransition table = next state

25
Q

What is the difference between:

S-R Latch

D Latch

D FlipFlop

A

S-R:

S=1,R=0 - set the input to 1

S=0,R=1 - reset to zero

S=0,R=0 - hold current value

S=1,R=1 - Is bad MMk

D-latch:

Same as S-R, but now we have extra logic and have

D input and E (or WE)

When E is enabled we set whatever D is.

When E is disabled, it just holds current value

Things change entirely dependant on E.

D Flip-Flop:

It is the same as a D-latch, but there are two chained and the enable is effectively a clock and changes only occur on a rising clock edge

26
Q

What is the symbol for a D flip-flop?

A

The only difference between this symbol and a D-latch is the invesion on E.

27
Q

What does a device controller contain?

A

A device controller contains the following:

  • Control/Status Registers:
    • CPU tells device what operations to perform by writing to control register(s)..
    • CPU checks the status of an operation by reading status register(s)
  • Data Registers - used by CPU to transfer data to/from device
  • Device Electronics
    • this performs the actual operations on the device
    • for example, pixels to screen, bits to/from disk, characters from keyboard
28
Q

What is port-mapped IO?

A

CPU has direct access to the device registers

has seperate address space from main memory

There is dedicated instructions for accessing device registers

29
Q

What is memory-mapped IO?

A

Assign a main memory address to each device registers

use existing data movement instructions (LD, ST) to access the device registers

Not actually accessing RAM, but instead these addresses map to device registers

30
Q

What is the pros/cons of Port-mapped/Memory Mapped IO?

A

Benenfits of dedicated port-mapped IO

  • Doesn’t use up any (main) memory locations

Benefits of memory mapped IO

  • Regular memory instruction can be used along with the addressing modes associated with these instructions
  • Less complex than dedicated IO instructions
31
Q

With regard to CPU data timing

What is the difference between Synchonous transfer and Asynchronous transfer?

A

Synchronous transfer

  • data is supplied at a known fixed rate
  • CPU reads/write every X cycles, where X is pre-determined

Asynchronous transfer

  • data rate is less predicatable
  • CPU must synchronize with device, so that it doesn’t miss data or write too quickly
  • This can be done using the status registers of the device.
32
Q

What is the difference between polling and interrupts?

A
33
Q

In general, how does polling work for the keyboard in LC-3?

A
34
Q

Why would interupts be better than polling?

A
35
Q

How does an interupt work with a device?

A
36
Q

What must the CPU do when it runs an interrupt service routine?

A
37
Q

What state information needs to be saved by the CPU when it need to execute an ISR?

A
38
Q

What is the supervisor stack in LC-3?

Where is the supervisor stack pointer saved, where is the User stack saved?

A

Supervisor mode grants the program control of all functions of the machine.

When switched over to supervisor mode, it uses a new stack, the supervisor stack.

Normally we use R6 to keep track of the user stack. LC-3 does not use an actual seperate stack, it layers on top of the user stack.

So when supervisor mode is engaged, the user stack is in R6 is saved to save.USP and R6 is loaded with saved.SSP and vice versa

Supervisor stack saved: saved.SSP

User stack is saved: saved.USP

39
Q

What is the general process that occurs when CPU is about to invoke an ISR?

A
40
Q

Whats the difference between an ISR and a regular subroutine?

A

It executes in supervisor mode whereas regular subroutines execute in user mode

ISRs are called by the CPU to handle an interrupt service request whereas regular subroutines are called by other user code

An ISR executes the instruction RTI when it is finished whereas a reguar subroutine executes the instruction RET when it is finished.

41
Q

What happens when RTI is called by an ISR?

A
42
Q

What are the components involved in executing traps?

A
43
Q

What is the run latch? How does it relate to Trap x25?

A