Close

Packed Flags

A project log for Lookup Table ALU

Optimized tables to occupy a 20addressbit x 16databit device

ken-kd5zxgKen KD5ZXG 07/05/2020 at 11:570 Comments

Simultaneous conventional flag output from one device can be had at the loss of Carry Select and eight alternate tables. I have a plan B, called "packed flags", to store much more efficiently. But doesn't allow simultaneous output and still wants at least two tables to hold them.

Collision of byte A vs byte B nets 16 all purpose flags, with no operation specified but "flag lookup". We may choose not to waste time examining bytewise results that supposedly threw these flags. Just knowing the flag might be enough. But which 16 flags? Thats the important question. Some possibilities:

Carry((A+B)+0) aka A+B>0xFF
Carry((A+B)+1) aka A+B>0xFE
Borrow((A-B)-0) aka A<B
Borrow((A-B)-1) aka A<=B
Borrow((B-A)-0) aka A>B
Borrow((B-A)-1) aka A=>B
FunFlag(A,B,0) whatever bit might rotate or swap out of a single byte function sans carry
FunFlag(A,B,1) whatever bit might rotate or swap out of a single byte function with carry
A=B+1
A=B-1
A=B aka Compare's Zero (Might get the axe in favor of an external NOR gate that checks Zero of any operation)

Well, that's ten or eleven of sixteen. Got plenty more ideas, but they are all sort of goofy. Do I really need a flag bit that tells if AB is prime? Yeah, that sort of goofy... More old notes to consult. Practical ideas must have passed my mind at some point.

All functions that make the cut must prove worthy. Like some rotations seem redundant to multiply and divide, you wouldn't expect duplicate entries to be wasted on them. Unless they need to throw a flag, which multiply can't do.

Ten plus Overflow flags for six flavors of math could make sixteen. But who actually uses overflow, seriously? Don't want a half carry since BCD to BIN and BIN to BCD tables don't need one. Don't need a negative flag, since any bit of any lookup can direct branching, just branch on the sign. 

Interrupt status can't be looked up in a table, would make no sense to pack those as pre-calculated flags. Maybe they should work in the same manner as the external gate that tests for Zero. Has Zero now become an interrupt?

I've got enough flags to fill a table and call it quits, I just want six BETTER choices than useless overflows...

Discussions