adumont / hrm-cpu

Human Resource Machine - CPU Design #HRM
https://twitter.com/i/moments/1017515777610649601
GNU General Public License v3.0
71 stars 8 forks source link

ALU: split aluCtl in two #3

Closed adumont closed 6 years ago

adumont commented 6 years ago

The ALU can perform 6 operations depending on signal aluCtl:

aluCtl Operation Output
0x0 R + M aluOut
0x1 R - M aluOut
x0x R = 0 ? flag
x1x R < 0 ? flag
1x0 M + 1 aluOut
1x1 M - 1 aluOut

Clearly, aluCtl could be split in two, see below, and its bits reorganized (but it would mean change a lot of things and all the documentation and images...)

Do before starting with ALU.

aluCtl Operation Output
x00 R + M aluOut
x01 R - M aluOut
x10 M + 1 aluOut
x11 M - 1 aluOut
0xx R = 0 ? flag
1xx R < 0 ? flag
adumont commented 6 years ago

Don't forget impact on FSM (JUMP/JUMPZ/JUMPN) control signals

Then update screenshots...

adumont commented 6 years ago

No impact on ADD/SUB as same aluCtl[0]. Impact on BUMP+/- and JUMPZ/N control signals, but not documented nor implemented yet. Google Spreadsheet updated accordingly to reflect new signals.

adumont commented 6 years ago

Changes done in a28bf8e99864151a42b9fc279d4b3957d16ce88d