Close

Hardware description

A project log for Bit-serial CPU based on crossbar switch

256 switches and few shift registers to implement a working 16 or 32-bit integer arithmetic calculator (+, -, *, /, isqrt, BCD / bin conv..)

zpekiczpekic 04/10/2022 at 02:460 Comments

The hardware for this project is a combination of FPGA and discrete ICs wired on the breadboard:

The 2 MT8816 chips implement the cross-bar switch matrix (2 * 8 * 16 = 16 rows * 16 columns), while the rest of the system is implemented inside the FPGA:

Few things to note:

MT8816 are "analog switches" - meaning that voltage on inputs is reflected on outputs. This works well with FPGA board because it operates with 3.3V digital I/O pins, so that same voltage level can be picked up as input. Therefore no special voltage level adaptation is needed on X and Y cross-bar connections (also they are interchangeable, in this design X is output, Y is input (looking from the FPGA)

To implement "wire OR" on inputs, FPGA I/O pins are programmed with pull-down, for example PMOD "JD" that receives Y7:0:

## JD
    NET "JD1"    LOC = AB13    |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L41N_VREF_2,            Sch name = JD1
    NET "JD2"    LOC = Y12    |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L42N_2,                        Sch name = JD2
    NET "JD3"    LOC = T11    |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L43N_2,                        Sch name = JD3
    NET "JD4"    LOC = W10    |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L44N_2,                        Sch name = JD4
    NET "JD7"    LOC = W12    |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L42P_2,                        Sch name = JD7
    NET "JD8"    LOC = R11    |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L43P_2,                        Sch name = JD8
    NET "JD9"    LOC = V11    |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L44P_2,                        Sch name = JD9
    NET "JD10"    LOC= T10        |    PULLDOWN    |    IOSTANDARD=LVCMOS33;    #Bank = 2, pin name = IO_L45P_2,        

The M8816 must be powered with usual 5V / GND - that's where the PowerBRICK comes into play as simple and convenient way to boost 3.3V to 5V

The control signals to MT8816 must be TTL compatible. There are of course ICs that can do safe and efficient signal level conversion, but for the breadboard has no place for those. Instead, a trick was used:

This works well except the speed - a RC circuit is introduced which needs time to charge/discharge, and a result the whole system does not work reliable above 1.5MHz clock speed. But that is of no importance for this proof of concept. 

From the FPGA perspective, this outside cross-bar switch appears as a 16*16 matrix of 1-bit write-only memory (state of switch can be set, but not read back). Following operations are supported:

The above requires 6 signals in 3 fields defined in the microcode:

// System interface signals
MT_CTRL        .valfield 2 values 
            nop,
            on,
            off,
            clear default nop;
                
MT_ROW        .valfield 4 values * default 0;
MT_COL        .valfield 4 values * default 0;

In order to observe the right MT8816 control signal timing (set up and hold times), a 4-phase clock is introduced and some signals are enabled only during the right phase:

-- 4 phase clock to activate strobe at right time
phi0 <= '1' when (mt_cnt = "00") else '0';
phi1 <= '1' when (mt_cnt = "01") else '0';
phi2 <= '1' when (mt_cnt = "10") else '0';
phi3 <= '1' when (mt_cnt = "11") else '0';

Discussions