optional next presentations: execute last jlt opcode , clocks 109 to 117 or

41
11010 10110 10100 10111 10000 01011 10111 11011 10110 11010 11000 00010 11011 11000 10000 00000 00000 01110 00101 00000 10000 00000 00100 01110 FETCH CIRCUITRY INCREM ENTOR EXECUTE CIRCUITRY ARITHM ETIC & LOGIC UNIT (ALU) D R E S S D E CLOCK ACCUM ULATOR OPCODE OPERAND ADDRESS JUM P ADDRESS INSTRUCTION REGISTERS PROGRAM COUNTER LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL OPCODE IN ACCUM ULATOR INSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL M EM OPCODE IN LO AD cents JLT nickel D one: SUB nickel STOR cents LO AD count INC STOR count JM P Again: HALT 14 5 0 JM P Again: # copy the value at‘cents’ to the Accum ulator # ifthe value at‘nickel’ is less than the Accum ulatorthen # jum p to the address ‘D one:’ # subtractthe value at‘nickel’ from the Accum ulator # and putthe resultback into the Accum ulator # copy the value in the Accum ulatorto ‘cents’ # copy the value ataddress ‘count’ to the Accum ulator # add 1 to the Accum ulator # copy the value in the Accum ulatorto ‘count’ # unconditional jum p to the address ‘Again:’ # stop the processor– end ofprogram # variable --the nam e ‘cents’ is the address and 14 is the value # variable --the nam e ‘cents’ is the address and 5 is the value # variable --the nam e ‘count’ is the address and 0 is the value # unconditional jum p to the address ‘Again:’ Assem bly Language Addresses: Program : Explanation Again: D one: cents nickel count 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F H ex 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F Clock 19 just before startof SUB

Upload: riona

Post on 09-Jan-2016

23 views

Category:

Documents


0 download

DESCRIPTION

Optional Next Presentations: Execute last JLT opcode , clocks 109 to 117 or Execute full program with separate control line and bus slides for each clock. End of Presentation. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00100

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 19just

before start of

SUB

Page 2: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Fetch Circuitry

Opcode Register in bus enable

Operand Register in bus enable

Opcode Register Write

Program Counter Write

Increment Program Counter

Operand Register Write

Jump Register in bus enableJump Register Write

Control Lines OutData Bus to Fetch Circuitry Opcode In bus enable

Program Counter to Incrementor bus enable

Q

QSET

CLR

D

Clock in

Reset

Clock 1

Q

QSET

CLR

D

Clock 2

Q

QSET

CLR

D

Clock 3

Q

QSET

CLR

D

Clock 4

Q

QSET

CLR

D

Clock 5

Q

QSET

CLR

D

Clock 6

Program Counter to Address Bus enable

Detect HALT, INC, and NOT

Detect JMP

Detect all jumps (JMP, JEQ, JNE, JLT, JGE, JGT, JLE)

Fetch Opcode

Fetch Opcode

Increment Program Counter

Fetch Operand Address

Fetch Operand Address

Increment Program Counter

Increment Program Counter

Fetch Jump Address

Fetch Jump Address

Opcode In

If HALT, INC, and NOT, then reset the Ring Counter.

If not JEQ, JNE, JLT, JGE, JGT, or JLE then reset the Ring Counter.

If JMP then fetch the Jump Address otherwise fetch the Operand Addreass. Only JEQ, JNE, JLT,

JGE, JGT, or JLE will make it to here because of the resets at Clock 2 and Clock 4.

Execute out

J

Q

Q

K

SET

CLR

Clock pause during

execute

1

1

Fetch in (from

execute circuitry) Ring Counter

Decode to determine how many additional fetches are needed.

Page 3: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00100

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 19Increment Program Counter(control)

Page 4: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Bus ControlI n p u t s F r o m B u s

AND AND AND AND AND

Control Line Input

O u t p u t

All output is 0 if Control Line is 0Identical to Inputs From Bus if Control Line is 1

0 0 1 0 0

1

00100

1 10 111 10 00

Page 5: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00100

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 19Increment Program Counter(control)

Page 6: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Incrementor

O u t p u t Input number + 1

Carry out

0 0 1 0 00 0 0 0 1

0 0 1 0 0

4

Decimal equivalent

+ 1

0 0 1 0 1 5

+

0 0 1 0 1

0 1 000

0 000

Left bus into ALU

INC opcode

00100 + 00001 4 + 1

10

Page 7: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00101

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 19Increment Program Counter(busses)

Page 8: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00100

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 20

Page 9: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Fetch Circuitry

Opcode Register in bus enable

Operand Register in bus enable

Opcode Register Write

Program Counter Write

Increment Program Counter

Operand Register Write

Jump Register in bus enableJump Register Write

Control Lines OutData Bus to Fetch Circuitry Opcode In bus enable

Program Counter to Incrementor bus enable

Q

QSET

CLR

D

Clock in

Reset

Clock 1

Q

QSET

CLR

D

Clock 2

Q

QSET

CLR

D

Clock 3

Q

QSET

CLR

D

Clock 4

Q

QSET

CLR

D

Clock 5

Q

QSET

CLR

D

Clock 6

Program Counter to Address Bus enable

Detect HALT, INC, and NOT

Detect JMP

Detect all jumps (JMP, JEQ, JNE, JLT, JGE, JGT, JLE)

Fetch Opcode

Fetch Opcode

Increment Program Counter

Fetch Operand Address

Fetch Operand Address

Increment Program Counter

Increment Program Counter

Fetch Jump Address

Fetch Jump Address

Opcode In

If HALT, INC, and NOT, then reset the Ring Counter.

If not JEQ, JNE, JLT, JGE, JGT, or JLE then reset the Ring Counter.

If JMP then fetch the Jump Address otherwise fetch the Operand Addreass. Only JEQ, JNE, JLT,

JGE, JGT, or JLE will make it to here because of the resets at Clock 2 and Clock 4.

Execute out

J

Q

Q

K

SET

CLR

Clock pause during

execute

1

1

Fetch in (from

execute circuitry) Ring Counter

Decode to determine how many additional fetches are needed.

0

10

Page 10: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00101

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 20Fetch 05

(control)

Page 11: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00101

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 20Fetch 05

(busses)

Page 12: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Address DecoderI n p u t f r o m A d d r e s s B u s

000102

03040506

07

08090A

0B0C0D

0E0F1011

12

131415161718

191A1B1C

1D

1E1F

A d d r e s s B u s

0 0 1 0 1

1

1

1

01

1

0

1

11

11

1

01

11

11

1

Page 13: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00101

01110 01011

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 20Fetch 05

(busses)

Page 14: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00100

01110

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 21

Page 15: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Fetch Circuitry

Opcode Register in bus enable

Operand Register in bus enable

Opcode Register Write

Program Counter Write

Increment Program Counter

Operand Register Write

Jump Register in bus enableJump Register Write

Control Lines OutData Bus to Fetch Circuitry Opcode In bus enable

Program Counter to Incrementor bus enable

Q

QSET

CLR

D

Clock in

Reset

Clock 1

Q

QSET

CLR

D

Clock 2

Q

QSET

CLR

D

Clock 3

Q

QSET

CLR

D

Clock 4

Q

QSET

CLR

D

Clock 5

Q

QSET

CLR

D

Clock 6

Program Counter to Address Bus enable

Detect HALT, INC, and NOT

Detect JMP

Detect all jumps (JMP, JEQ, JNE, JLT, JGE, JGT, JLE)

Fetch Opcode

Fetch Opcode

Increment Program Counter

Fetch Operand Address

Fetch Operand Address

Increment Program Counter

Increment Program Counter

Fetch Jump Address

Fetch Jump Address

Opcode In

If HALT, INC, and NOT, then reset the Ring Counter.

If not JEQ, JNE, JLT, JGE, JGT, or JLE then reset the Ring Counter.

If JMP then fetch the Jump Address otherwise fetch the Operand Addreass. Only JEQ, JNE, JLT,

JGE, JGT, or JLE will make it to here because of the resets at Clock 2 and Clock 4.

Execute out

J

Q

Q

K

SET

CLR

Clock pause during

execute

1

1

Fetch in (from

execute circuitry) Ring Counter

Decode to determine how many additional fetches are needed.

Page 16: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00101

01110 01011

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 21Increment Program Counter(control)

Page 17: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Incrementor

O u t p u t Input number + 1

Carry out

0 0 1 0 10 0 0 0 0

0 0 1 0 1

5

Decimal equivalent

+ 1

0 0 1 1 0 6

+

0 0 1 1 0

0 1 100

0 100

Left bus into ALU

INC opcode

00101 + 00001 5 + 1

10

Page 18: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 21Increment Program Counter(busses)

Page 19: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 22

Page 20: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Fetch Circuitry

Opcode Register in bus enable

Operand Register in bus enable

Opcode Register Write

Program Counter Write

Increment Program Counter

Operand Register Write

Jump Register in bus enableJump Register Write

Control Lines OutData Bus to Fetch Circuitry Opcode In bus enable

Program Counter to Incrementor bus enable

Q

QSET

CLR

D

Clock in

Reset

Clock 1

Q

QSET

CLR

D

Clock 2

Q

QSET

CLR

D

Clock 3

Q

QSET

CLR

D

Clock 4

Q

QSET

CLR

D

Clock 5

Q

QSET

CLR

D

Clock 6

Program Counter to Address Bus enable

Detect HALT, INC, and NOT

Detect JMP

Detect all jumps (JMP, JEQ, JNE, JLT, JGE, JGT, JLE)

Fetch Opcode

Fetch Opcode

Increment Program Counter

Fetch Operand Address

Fetch Operand Address

Increment Program Counter

Increment Program Counter

Fetch Jump Address

Fetch Jump Address

Opcode In

If HALT, INC, and NOT, then reset the Ring Counter.

If not JEQ, JNE, JLT, JGE, JGT, or JLE then reset the Ring Counter.

If JMP then fetch the Jump Address otherwise fetch the Operand Addreass. Only JEQ, JNE, JLT,

JGE, JGT, or JLE will make it to here because of the resets at Clock 2 and Clock 4.

Execute out

J

Q

Q

K

SET

CLR

Clock pause during

execute

1

1

Fetch in (from

execute circuitry) Ring Counter

Decode to determine how many additional fetches are needed.

0 1 0

SUB opcode

0 1 0 1 1

1 1

11

10

001

0

1

10

1

1

1 00

0

0

0

0

0

0

0

00

1

1

0

1

1

Page 21: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 22Fetch 06

(control)

Page 22: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110001010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011 10111

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 22Fetch 06

(busses)

Page 23: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Fetch Circuitry

Opcode Register in bus enable

Operand Register in bus enable

Opcode Register Write

Program Counter Write

Increment Program Counter

Operand Register Write

Jump Register in bus enableJump Register Write

Control Lines OutData Bus to Fetch Circuitry Opcode In bus enable

Program Counter to Incrementor bus enable

Q

QSET

CLR

D

Clock in

Reset

Clock 1

Q

QSET

CLR

D

Clock 2

Q

QSET

CLR

D

Clock 3

Q

QSET

CLR

D

Clock 4

Q

QSET

CLR

D

Clock 5

Q

QSET

CLR

D

Clock 6

Program Counter to Address Bus enable

Detect HALT, INC, and NOT

Detect JMP

Detect all jumps (JMP, JEQ, JNE, JLT, JGE, JGT, JLE)

Fetch Opcode

Fetch Opcode

Increment Program Counter

Fetch Operand Address

Fetch Operand Address

Increment Program Counter

Increment Program Counter

Fetch Jump Address

Fetch Jump Address

Opcode In

If HALT, INC, and NOT, then reset the Ring Counter.

If not JEQ, JNE, JLT, JGE, JGT, or JLE then reset the Ring Counter.

If JMP then fetch the Jump Address otherwise fetch the Operand Addreass. Only JEQ, JNE, JLT,

JGE, JGT, or JLE will make it to here because of the resets at Clock 2 and Clock 4.

Execute out

J

Q

Q

K

SET

CLR

Clock pause during

execute

1

1

Fetch in (from

execute circuitry) Ring Counter

Decode to determine how many additional fetches are needed.

0 1 0

SUB opcode

0 1 0 1 1

1 1

11

10

001

0

1

10

1

1

1 00

0

0

0

0

0

0

0

00

1

1

0

1

1

Reset

0 1

0

Page 24: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 23Transfer

to Execute

Page 25: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Execute Circuitry

HALT - disables clock input (not implemented)

INC

NOTANDOR

XOR

ADD

SUB

JEQ

JMP

JNEJLTJGEJGT

JLE

LOAD

STOROpcode Register out bus enableOperand Register out bus enableJump Address Register out bus enable

Memory Write

ALU ADD enableALU SUB enableALU INC enable

Accumulator out to ALU Left in enableAccumulator out to Data Bus enableAccumulator Write

Control Lines Out

Data Bus to ALU Right in enableData Bus to Accumulator in enable

Opc

ode

Regi

ster

out

bus

ena

ble

Ope

rand

Reg

iste

r out

bus

ena

ble

Mem

ory

Writ

e

ALU

AD

D e

nabl

eAL

U S

UB

enab

leAL

U IN

C en

able

Accu

mul

ator

out

to A

LU L

eft in

ena

ble

Accu

mul

ator

out

to D

ata

Bus

enab

leAc

cum

ulat

or W

rite

Dat

a Bu

s to

ALU

Rig

ht in

ena

ble

Dat

a Bu

s to

Acc

umul

ator

in e

nabl

e

ALU Jump Comparison

Logi

c op

code

s no

t im

plem

ente

d

Opcode bus in

Q

QSET

CLR

D

Clock in

Clock 1

Q

QSET

CLR

D

J

Q

Q

K

SET

CLR

1

1

Execute in (from fetch

circuitry)

Fetch out (to fetch circuitry)

Clock 2

Activate opcode

Decode and

execute opcode

Q

QSET

CLR

D

Clock 3

Third Clock for

AND, SUB, and INC

Reset after two clocks

Program Counter Write

Prog

ram

Cou

nter

Writ

e

Choose output for third clock

0

0

0

0

0

00

0

0

0

1

0

0

Page 26: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011 10111

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 23Execute,activateopcode

(control)

Page 27: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011 10111

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 23Execute,activateopcode(busses)

Page 28: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Execute Circuitry

HALT - disables clock input (not implemented)

INC

NOTANDOR

XOR

ADD

SUB

JEQ

JMP

JNEJLTJGEJGT

JLE

LOAD

STOROpcode Register out bus enableOperand Register out bus enableJump Address Register out bus enable

Memory Write

ALU ADD enableALU SUB enableALU INC enable

Accumulator out to ALU Left in enableAccumulator out to Data Bus enableAccumulator Write

Control Lines Out

Data Bus to ALU Right in enableData Bus to Accumulator in enable

Opc

ode

Regi

ster

out

bus

ena

ble

Ope

rand

Reg

iste

r out

bus

ena

ble

Mem

ory

Writ

e

ALU

AD

D e

nabl

eAL

U S

UB

enab

leAL

U IN

C en

able

Accu

mul

ator

out

to A

LU L

eft in

ena

ble

Accu

mul

ator

out

to D

ata

Bus

enab

leAc

cum

ulat

or W

rite

Dat

a Bu

s to

ALU

Rig

ht in

ena

ble

Dat

a Bu

s to

Acc

umul

ator

in e

nabl

e

ALU Jump Comparison

Logi

c op

code

s no

t im

plem

ente

d

Q

QSET

CLR

D

Clock in

Clock 1

Q

QSET

CLR

D

J

Q

Q

K

SET

CLR

1

1

Execute in (from fetch

circuitry)

Fetch out (to fetch circuitry)

Clock 2

Activate opcode

Decode and

execute opcode

Q

QSET

CLR

D

Clock 3

Third Clock for

AND, SUB, and INC

Reset after two clocks

Program Counter Write

Prog

ram

Cou

nter

Writ

e

Choose output for third clock

0

0

0

1

1

01

1

0

0

0

0

0

SUB opcode

0 1 0 1 1

Opcode bus in0 1 0 1 1

0

0 1

0

1

0 0

00

01 11

1

1

11

1 1

111

01

101

01

1

1

1

Page 29: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011 10111

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 24Execute,

SUBNickel

(Part 1)(control)

Page 30: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011 10111

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 24Execute,

SUBNickel

(Part 1)(busses)

14 - 5Enters the ALU

Page 31: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

A L U(Arithmetic and Logic Unit)

Invertor

Five Bit Adder

Incrementor

Left bus into ALU

ALU Data Bus Out

SUBADD

Control Lines InINC

Right bus into ALU Jump Logic Arithmetic

Activate Five Bit Adder

Turn off left bus to Incrementor crossover

Turn on left bus to Incrementor crossover

SUB opcode

01110 – 0010114 - 5

01110 00101

01110

Less Than

Greater ThanLess Than or Equal

Not EqualEqual

Control Lines In

Greater Than or Equal

Equality

Inequality (Greater Than)

Right bus into ALU

Jump Decision Out

Left bus into ALU

00101

Page 32: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Invertor

O u t p u t

twos complement of the input bus

Bus input

1 1 1 1 1

0 1 0 10

0 0 1 0 1

1 0 1 01

Page 33: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

A L U(Arithmetic and Logic Unit)

Invertor

Five Bit Adder

Incrementor

Left bus into ALU

ALU Data Bus Out

SUBADD

Control Lines InINC

Right bus into ALU Jump Logic Arithmetic

Activate Five Bit Adder

Turn off left bus to Incrementor crossover

Turn on left bus to Incrementor crossover

SUB opcode

01110 – 0010114 - 5

01110 00101

11010

11010

01110

Less Than

Greater ThanLess Than or Equal

Not EqualEqual

Control Lines In

Greater Than or Equal

Equality

Inequality (Greater Than)

Right bus into ALU

Jump Decision Out

Left bus into ALU

Page 34: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Incrementor

O u t p u t Input number + 1

Carry out

1 1 0 1 00 0 0 0 1

1 1 0 1 0

1 1 0 1 1

+

1 1 0 1 1

1 0 011

0 000

Left bus into ALU

INC opcode

11010 + 00001

10

Page 35: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

A L U(Arithmetic and Logic Unit)

Invertor

Five Bit Adder

Incrementor

Left bus into ALU

ALU Data Bus Out

SUBADD

Control Lines InINC

Right bus into ALU Jump Logic Arithmetic

Activate Five Bit Adder

Turn off left bus to Incrementor crossover

Turn on left bus to Incrementor crossover

SUB opcode

01110 – 0010114 - 5

01110 00101

11010

11011

11010

11011

01110

Less Than

Greater ThanLess Than or Equal

Not EqualEqual

Control Lines In

Greater Than or Equal

Equality

Inequality (Greater Than)

Right bus into ALU

Jump Decision Out

Left bus into ALU

Page 36: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Five Bit Adder

O u t p u t

Accurate addition of two 5-bit binary numbers.

Carry out

0 1 1 1 01 1 0 1 1

0 1 1 1 0

1 1 0 1 1

1 4

Decimal equivalent

0 1 0 0 1 9

+

0 1 0 0 1

0 1 0

0

1

11

1

1

0

1

1

10

1 1 011

0

Left bus from ALU

Two’s Compiment from Right bus, after Invertor

and Incrementor

SUB opcode

01110 – 0010114 - 5

Carry is ignored in SUB

+ (-5)

Page 37: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

A L U(Arithmetic and Logic Unit)

Invertor

Five Bit Adder

Incrementor

Left bus into ALU

ALU Data Bus Out

SUBADD

Control Lines InINC

Right bus into ALU Jump Logic Arithmetic

Activate Five Bit Adder

Turn off left bus to Incrementor crossover

Turn on left bus to Incrementor crossover

SUB opcode

01110 – 0010114 - 5

01110 00101

11010

11011

11010

11011

01110

01001

Less Than

Greater ThanLess Than or Equal

Not EqualEqual

Control Lines In

Greater Than or Equal

Equality

Inequality (Greater Than)

Right bus into ALU

Jump Decision Out

Left bus into ALU

Page 38: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01110 01011 10111

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 25Execute,

SUBNickel

(Part 2)(busses)

14 - 5equals 9

Page 39: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Execute Circuitry

HALT - disables clock input (not implemented)

INC

NOTANDOR

XOR

ADD

SUB

JEQ

JMP

JNEJLTJGEJGT

JLE

LOAD

STOROpcode Register out bus enableOperand Register out bus enableJump Address Register out bus enable

Memory Write

ALU ADD enableALU SUB enableALU INC enable

Accumulator out to ALU Left in enableAccumulator out to Data Bus enableAccumulator Write

Control Lines Out

Data Bus to ALU Right in enableData Bus to Accumulator in enable

Opc

ode

Regi

ster

out

bus

ena

ble

Ope

rand

Reg

iste

r out

bus

ena

ble

Mem

ory

Writ

e

ALU

AD

D e

nabl

eAL

U S

UB

enab

leAL

U IN

C en

able

Accu

mul

ator

out

to A

LU L

eft in

ena

ble

Accu

mul

ator

out

to D

ata

Bus

enab

leAc

cum

ulat

or W

rite

Dat

a Bu

s to

ALU

Rig

ht in

ena

ble

Dat

a Bu

s to

Acc

umul

ator

in e

nabl

e

ALU Jump Comparison

Logi

c op

code

s no

t im

plem

ente

d

Q

QSET

CLR

D

Clock in

Clock 1

Q

QSET

CLR

D

J

Q

Q

K

SET

CLR

1

1

Execute in (from fetch

circuitry)

Fetch out (to fetch circuitry)

Clock 2

Activate opcode

Decode and

execute opcode

Q

QSET

CLR

D

Clock 3

Third Clock for

AND, SUB, and INC

Reset after two clocks

Program Counter Write

Prog

ram

Cou

nter

Writ

e

Choose output for third clock

0

0

0

1

1

11

1

0

0

0

0

0

SUB opcode

0 1 0 1 1

Opcode bus in0 1 0 1 1

0

0 1

0

1

0 0

00

01 11

1

1

11

1 1

111

11

101

01

1

1

1

1

Page 40: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

1101010110101001011110000010111011111011101101101011000000101101111000100000000000000

011100010100000

1000000000

00110

01001 01011 10111

FETCH CIRCUITRY

INCREMENTOR

EXECUTE CIRCUITRY

ARITHMETIC &LOGIC UNIT

(ALU)

ADDRESS

DECODER

CLOCK

ACCUMULATOR

OPCODE OPERANDADDRESS

JUMPADDRESS

INSTRUCTION REGISTERS

PROGRAM COUNTER

LOAD PROGRAM INSTRUCTION COUNTER REGISTERS EXECUTE CONTROL

OPCODE IN

ACCUMULATORINSTRUCTION REGISTER CONTROL CONTROL ALU CONTROL MEM

OPCODE IN

LOADcentsJLTnickelDone:SUBnickelSTORcentsLOADcountINCSTORcountJMPAgain:HALT

1450

JMPAgain:

# copy the value at ‘cents’ to the Accumulator

# if the value at ‘nickel’ is less than the Accumulator then# jump to the address ‘Done:’

# subtract the value at ‘nickel’ from the Accumulator# and put the result back into the Accumulator# copy the value in the Accumulator to ‘cents’

# copy the value at address ‘count’ to the Accumulator

# add 1 to the Accumulator# copy the value in the Accumulator to ‘count’

# unconditional jump to the address ‘Again:’

# stop the processor – end of program

# variable -- the name ‘cents’ is the address and 14 is the value# variable -- the name ‘cents’ is the address and 5 is the value# variable -- the name ‘count’ is the address and 0 is the value

# unconditional jump to the address ‘Again:’

Assembly LanguageAddresses: Program: Explanation

Again:

Done:

centsnickelcount

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Hex

000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F

Clock 25Execute,

SUBNickel

(Part 2)(busses)

14 - 5equals 9

Page 41: Optional Next Presentations:  Execute  last JLT  opcode , clocks  109 to 117 or

Optional Next Presentations:

Execute last JLT opcode, clocks 109 to 117or

Execute full program with separate control line and bus slides for each clock

End of Presentation