Midterm Flashcards
How do you objectively campare the complexity of two circuits
number of gates. max propogation delay, number of transistors
JSR - 6502
jump to sub routine, push the address of the next op on to the stack
TSX - 6502
transfer stack pointer to x.
minumum # of basic logic gates for a half adder
2
minimmum # of basic logic gates for a full adder
5
Universal set
express any boolean function using only the gates in S
Name the universal sets
AND,OR,NOT NAND NOR AND, NOT
SCRAM lacked circuitry for what commands?
JMZ, ADD, SUB
the ones complement of signed integers has two zeros +0 and -0
true: 0000, 1111
Ones compliment
obtained by inverting all bits in the binary number. negative if first digit is 1
6502 BNE command
branches if zero flag is clear.
6502 BCC
branches if carry flag clear
6502 BCS
branches if carry flag set
6502 BEQ
branches if zero flag set
6502 BMI
branch if negative flag set
6502 BPL
Branches if negativ eflag clear
6502 BVC
branch if overflow flag clear
6502 BVS
branch if overflow flag set
twos compliment of 5 bit range
-2^4 to 2^4 -1
The encoding for all 6502 instructions is between 2 and 4 bytre long
false, sta $ffff is 5 bytes, ASL and TXA are 1
of SCRAM machine instructions
16 - there are 16 pins
6502 CLC
clear carry flag
6502 CLD
clear decimal mode flag
6502 CLI
clear interrupt disable flag
6502 CLV
clear overflow flag
6502 SEC
set carry flag
6502 SED
set decimal mode flag
6502 SEI
set interrupt disable flag
6502 ASL
arithmetic shift left
6502 LSR
logical shift right
6502 ROL
rotate left
6502 ROR
rotate right
CPX, CPY, CMP 6502
compare x, compare y, compare accumulator
\The compare instructions subtract (without carry) an immediate value or the contents of a memory location from the addressed register, but do not save the result in the register. The only indications of the results are the states of the three status flags: Negative (N), Zero (Z), and Carry (C). The combination of these three flags indicate whether the register contents are less than, equal to (the same as), or greater than the operand “data” (the immediate value or contents of the addressed memory location. The table below summarizes the result indicators for the compare instructions.
ADC/SBC 6502
Add/sub with carry
6502 PHA. PHP, PLA, PLP
Push accumulator on stack Push processor status on stack pull accumulator from stack pull processor status from stack
LDA, LDX, LDY
Load accumulator, load x, load y
add $a, $b, $c
a = b + c
addu $a, $b, $c
add unsigned
addi
adds constant
lw $t, C($s)
load word from MEM[$s + c] and following 3 bytes
lb $t, C($s)
loads byte from MEM[$s + c]
sw $t, C($s)
stores word into MEM[$s + c] and next 3 bits
sb $t, C($s)
stores the least-significant 8 bits of a register into MEM[$s +c]
and $d, $s, $t
bitwise $d = $s & $t
andi $t, $s, C
pads leftmost 16 bits with -s
beq $s,$t,C
jumps to c if equal
bne $s,$t,C
jumps if not equal
j C
jump to C
jr $s
go to address $s
jal
calls subrotine, jumps and links by copying program counter to $ra
MIPS add to stack
sub $sp, 4 sw $ra, ($sp)
MIPS subtract from stack
lw $ra, 0($sp) add $sp, 4 jr $ra
twos complement range
-2^(N-1) to 2^(N-1) - 1
twos complement
invert digits and add 1
NAND - and gate
NAND - OR gate
NAND - NOT Gate
NOR - AND gate
NOR - or gate
NOT From NOR gate
xor
RS latch
shift register
DNF
disjunctive normal form - zeros
a’b’ + ab
CNF
half adder
full adder
D type RS Latch
edge triggered, master slave flip flop
Bits of memeory in SCRAM
16 8 bit memory slots = 128bits
Size of addresses for SCRAM
4 bit
OP Code size in SCRAM
4 bits
total SCRAM instruction size
op code + addr = 8 bit
sign and magnitude
first bit says +/-
5 steps to pipelining MPS
- Fetch Instruction - read from memory
- Instruction Decoding - read source registers
- Execution- execute
- Memory Access - read/write
- Write Back- store
JMZ
jump in 6502 if AC is 0
issue with JMZ
no connection from IR to PC
no way to tell if AC was 0
Edge-triggered D-type flip-flop