Close

A Well-Rounded Instruction

A project log for BREDSAC

Electronic Dynamic Storage Breadboard Computer

gregewinggreg.ewing 11/16/2018 at 05:210 Comments

The Round instruction is meant to round the accumulator to 34 fractional bits, by adding 1 at bit 36 if bit 35 is 1. I managed to implement this without making any changes to the hardware. The strategy is to first shift word 1 of the accumulator left by one bit (by adding it to itself), so that bit 35 ends up in the carry flag, and then add the carry to words 2 and 3. Finally, words 0 and 1 are cleared.

# Y - Round accumulator to 34 fractional bits
   00110 0 0001 :  -   -   10  XAC   -  YAC   CY0  --   -   -   -  LSW  -    -    -   ---     -   ---    ----    # Shift word 1 of AC left
   00110 0 0010 :  -   -   01  XAC   -  Y0    --   WAC  -   -   -   -   -    -    -   ---     -   ---    ----    # Add carry to AC words 2 and 3
   00110 0 0011 :  -   -   11  XAC   -  Y0    --   WAC  -   -  MSW  -   -    -    -   ---     -   ---    ----
   00110 0 0100 :  -   -   00  X0    0  Y0    CY0  WAC  -   -   -  LSW  -    -    -   ---     -   ---    ----    # Clear AC words 0 and 1
   00110 0 0101 :  -  EOI  10  X0    0  Y0    --   WAC  -   -   -   -   -    -    -   ---     -   ---    ----

Discussions