An Adder A Subtractor
A and B are the inputs of the adder/ subtractor R is the output of the adder/ subtractor F is the control to tell it to add or subtract D is the status to tell us when it is done (or maybe something else?) Arithmetic Logic Unit
A Flip Flop A 4 bit register
Decoder Add Subtract AND OR Add Subtract AND OR To ALU
Op-codeMnemonicFunctionExample 001LOAD Load the value of the operand into the Accumulator LOAD STOREStore the value of the Accumulator at the address specified by the operandSTORE 8 011ADDAdd the value of the operand to the AccumulatorADD #5 100SUBSubtract the value of the operand from the AccumulatorSUB #1 101EQUAL If the value of the operand equals the value of the Accumulator, skip the next instruction EQUAL #20 110JUMP Jump to a specified instruction by setting the Program Counter to the value of the operand JUMP 6 111HALTStop executionHALT A simple machine language
#Machine codeAssembly codeDescription LOAD #5 These two operations set the count value to five STORE LOAD #0Initialize the count to zero EQUAL 15 Test to see if count is complete; if yes, skip next instruction and go to instruction 5; if no, go to next instruction JUMP #6Set Program Counter to HALT Stop execution ADD #1Increment the count in the Accumulator JUMP #3Set Program Count to 3.
Von Neumann Architecture Harvard Architecture
Atmel Registers Note: R0 to R15 will not work with some instructions
Status Register I – Global Interrupt enable flag, must be set for interrupts to work T – Bit copy storage, used with BST and BLD H – Half carry flag, detects carry from lower nibble S – Sign flag, exclusive OR between N flag and V flag V – Two’s complement overflow flag N – Negative flag, result of an operation is negative Z – zero flag, result of an operation is zero C – Carry flag, indicates an overflow after count reaches 255