Papilio multiply

Problem
The goal is to multiply two four bit numbers in hardware. The goal is to build a little bit of a CPU that was originally a separate chip called a math co-processor or ALU. The goal is to demonstrate it's operation on a papilio with a logic start mega wing. This project was inspired by Fig. 8.19 page 465, of Chapter 8 (Algorithmic State Machines) of the text book "Digital Principles and Design" by Donald D. Bivone First Edition copyright 2003.

Conceive
This problem can be done with simple VHDL code. It can be done with Intellectual Property (IP) of the major FPGA vendors. Or it can be done from scratch using an Algorithmic State Machine (ASM) which is started through an OpCode which the CPU finds in it's instruction register, two 4 bit shift registers, a 4 bit adder, a flipflop and a counter.

The goal is to build an intuition/confidence that one is actually design part of a CPU. Specifically a CPU's shift registers, latch and adder are the shared resources used. The ASM circuit is actually using these shared resources to create a multiplication operation.

The goal is to write the VHDL with tests for each module, then put it all together with a VHDL test and finally implement in a papilio using 8 switches on the logic start mega wing to input two 4 bit numbers and display 8 bits of the results on the logic start LEDs.

Design
This project depends upon a lot of little circuits working. The goal was to start with the Wikibook designs, and then add to them, or modify them.





Design a circuit to sit inbetween 8 wires turning 8 LED’s off and on.

Have 3 inputs … ABC … 8 LED’s

Input “A” turns off and on the first four LED’s. If the LED is off (representing a zero) it stays off. If the LED is on (representing a 1), then it turns off or on depending on the value of A. At least one of the 4 LEDs will always be on.

The other two inputs are more complicated. They control the other 4 LEDs. This circuit does not control whether the LED is on or off. This circuit controls whether they are solid or flashing. There are five states of these 4 LEDs: So there is a total of 5 states. The two inputs B,C are used as follows. As long as B is high, step to the next state until at the last state. Otherwise stay in the current state.
 * Solid solid solid solid
 * Solid solid solid flashing
 * Solid solid flashing flashing
 * Solid flashing flashing flashing
 * flashing flashing flashing flashing

Stay at the last state until input C is high, and then start over. The value of B doesn’t matter when at the last state or when transitioning to the first state.

The Flashing desired is this:
 * if originally a 0 … then off on off … off on off … two offs then on (repeat)
 * if originally a 1 … then on off on … on off on … two ons then off(repeat)

The seven segment display will light up to show the input numbers or the product. This is determined by the SD_Toggle signal. If displaying the multiplier and multiplicand, then the first two displays will show the first number, while the last two will display the second. If the product is to be shown, then the first display will be blank, the second will be blank if the product is less than 100, the third will be blank if the product is less than 10, and the fourth will show the ones place.

To simplify the process of decoding the output, this module will translate the binary code into binary coded decimal. It will also read the toggle, so that it will either output two five-bit strings for the multiplier and multiplicand or a single ten-bit string for the product.

In designing the circuit that controls the LEDs showing the 4 least significant bits (lsb), we first focused on building the state machine. We actually needed 3 inputs: one input signaling that the register has been cleared and received the multiplier(first state), one input signaling the shift, and one input holding the value of the least significant bit of the partial sum stored in the register.

To ensure that the state machine is working, we decided to light all 4 LEDs once the clear signal is on, and turn them off to simulate the shift. Then we decided to add the flashing desired. It turned out to be the most challenging part:


 * We first added the modules we built from other projects. We customized the .coe file to match one LED. The LED will just turned off. We decided to test the file on its own, and despite enabling only one LED, all will lit up with solid light. The goal was to see if we could customize the .coe file to match the pattern for 0 or 1 being concatenated.
 * Then, we decided to blink the LEDS. We tested the code to blink the LEDs by itself and it worked. Then we add it as a module. First, it turned the LED off. There was no blinking. We decided to make it a process but it seems we cannot have a 'rising_edge(clk)' twice when designing a circuit. You can only use 'if' in a process, so we added the counter in different parts of our main process with no success. The signal that was supposed to blink the LEDs is never assigned so the compiler will give a constant value of 0. Therefore, it just turns off the LEDs. We decided then to blink the LEDs from the module. It did not work either. We finally tried to have as bidirectional ports the LEDs in the module and in the main vhdl code, it showed the LEDs having multiple drivers.

You will find below the code to blink the LEDs (We have two different patterns to represent 0 or 1). We also have the ASM for the flash-led circuit. We are using switches to simulate our three inputs. The "concatenated" bit did not work out so well with the switch but we needed to test it somehow and it can be implemented.

Implement
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;

entity SWITCH_LED is Port ( SWITCH : in STD_LOGIC_VECTOR(7 downto 0);       LED    : out STD_LOGIC_VECTOR(7 downto 0)); end SWITCH_LED;

architecture Behavioral of SWITCH_LED is signal x : STD_LOGIC_VECTOR(3 downto 0); signal y : STD_LOGIC_VECTOR(3 downto 0); -- signal carry : STD_LOGIC_VECTOR(3 downto 0); signal result : STD_LOGIC_VECTOR(7 downto 0); begin x <= SWITCH(3 downto 0); y <= SWITCH(7 downto 4); result <= x * y;	LED <= result ;

end Behavioral;

You can also find out how to build a 4-state Mealy ASM here

library IEEE; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity SWITCH_LED is  Port (anodes  :   inout STD_LOGIC_VECTOR(3 downto 0);			switch :   in STD_LOGIC_VECTOR(7 downto 0);			JOY_SELECT : in STD_LOGIC;			clk : IN  std_logic;         segment : out STD_LOGIC_VECTOR(6 downto 0)); end SWITCH_LED;

architecture Behavioral of SWITCH_LED is signal counter: STD_LOGIC_VECTOR(30 downto 0); signal s : STD_LOGIC_VECTOR(1 downto 0); signal aen :   STD_LOGIC_VECTOR(3 downto 0); signal display :    STD_LOGIC_VECTOR(3 downto 0); signal x :   STD_LOGIC_VECTOR(3 downto 0); signal y :   STD_LOGIC_VECTOR(3 downto 0); signal product :  STD_LOGIC_VECTOR(7 downto 0); begin s <= counter(18 downto 17); aen <= "1111"; process(clk, counter) begin if rising_edge(clk) then counter <= counter + 1; end if; end process; process(s, counter) begin CASE s is	when "00" => display <= counter(29 downto 26); when "01" => display <= counter(25 downto 22); when "10" => display <= counter(21 downto 18); when others => display <= counter(17 downto 14); end CASE; end process; process(s, aen, anodes, product) begin anodes <= "1111"; if aen(conv_integer(s)) = '1' then anodes(conv_integer(s)) <= '0'; CASE anodes is			When "1101" => CASE switch(7 downto 4) IS					WHEN "0000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "0001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "0010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "0011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "0100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "0101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "0110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "0111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "1000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "1001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "1010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "1011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "1100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "1101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "1110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "1111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN OTHERS => segment(0) <='1'; segment(1) <='1'; segment(2) <='1'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; END CASE; When "1110" => if switch(7 downto 4) > "1001" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; else segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; end if; When "0111" => CASE switch(3 downto 0) IS					WHEN "0000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "0001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "0010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "0011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "0100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "0101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "0110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "0111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "1000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "1001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "1010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "1011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "1100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "1101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "1110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "1111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN OTHERS => segment(0) <='1'; segment(1) <='1'; segment(2) <='1'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; END CASE; When "1011" => if switch(3 downto 0) > "1001" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; else segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; end if; When OTHERS => segment(0) <='1'; segment(1) <='1'; segment(2) <='1'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; end case; end if; if JOY_SELECT ='0' then x <= switch(7 downto 4); y <= switch(3 downto 0); product <= x * y;		CASE anodes is			When "0111" => CASE product IS				WHEN "00000000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "00000001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00000010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "00000011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "00000100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00000101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00000110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00000111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00001000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00001001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00001010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "00001011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00001100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "00001101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "00001110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00001111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00010000" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00010001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00010010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00010011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00010100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "00010101" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00010110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "00010111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "00011000" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00011001" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00011010" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00011011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00011100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00011101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00011110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "00011111" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00100000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "00100001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "00100010" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00100011" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00100100" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00100101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00100110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00100111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00101000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "00101001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00101010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "00101011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "00101100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00101101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00101110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00101111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00110000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00110001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00110010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "00110011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00110100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "00110101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "00110110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00110111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00111000" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00111001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00111010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "00111011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "00111100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "00111101" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "00111110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "00111111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "01000000" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01000001" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01000011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01000100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01000101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01000110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "01000111" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01001000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "01001001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "01001010" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01001011" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01001100" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01001101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01001110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01001111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01010000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "01010001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01010010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "01010011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "01010100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01010101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01010110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01010111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01011000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01011001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01011010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "01011011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01011100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "01011101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "01011110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01011111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01100000" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01100001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01100010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01100011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01100100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "01100101" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01100110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "01100111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "01101000" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01101001" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01101010" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01101011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01101100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01101101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01101110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "01101111" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01110000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "01110001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "01110010" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01110011" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01110100" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01110101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01110110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01110111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01111000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "01111001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "01111010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "01111011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "01111100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01111101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "01111110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "01111111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10000000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10000001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10000010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "10000011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10000100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "10000101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "10000110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10000111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10001000" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10001001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10001010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10001011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10001100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "10001101" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10001110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "10001111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "10010000" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10010001" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10010010" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10010011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10010100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10010101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10010110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "10010111" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10011000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "10011001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "10011010" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10011011" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10011100" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10011101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10011110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10011111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10100000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "10100001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10100010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "10100011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "10100100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10100101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10100110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10100111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10101000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10101001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10101010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "10101011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10101100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "10101101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "10101110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10101111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10110000" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10110001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10110010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10110011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10110100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "10110101" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10110110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "10110111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "10111000" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10111001" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10111010" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10111011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "10111100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "10111101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "10111110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "10111111" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "11000000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "11000001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "11000010" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11000011" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11000100" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "11000101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "11000110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "11000111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11001000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "11001001" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "11001010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "11001011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "11001100" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11001101" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11001110" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "11001111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "11010000" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "11010001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11010010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "11010011" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "11010100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "11010101" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "11010110" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11010111" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11011000" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "11011001" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "11011010" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; WHEN "11011011" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11011100" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; WHEN "11011101" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; WHEN "11011110" => segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; WHEN "11011111" => segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; WHEN "11100000" => segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; WHEN "11100001" => segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; --					WHEN "11100010" => --					segment(0) <='0'; --					segment(1) <='1'; --					segment(2) <='0'; --					segment(3) <='0'; --					segment(4) <='0'; --					segment(5) <='0'; --					segment(6) <='0'; --					WHEN "11100011" => --					segment(0) <='0'; --					segment(1) <='0'; --					segment(2) <='0'; --					segment(3) <='1'; --					segment(4) <='1'; --					segment(5) <='1'; --					segment(6) <='1'; --					WHEN "11100100" => --					segment(0) <='0'; --					segment(1) <='0'; --					segment(2) <='0'; --					segment(3) <='0'; --					segment(4) <='0'; --					segment(5) <='0'; --					segment(6) <='0'; --					WHEN "11100101" => --					segment(0) <='0'; --					segment(1) <='0'; --					segment(2) <='0'; --					segment(3) <='0'; --					segment(4) <='1'; --					segment(5) <='0'; --					segment(6) <='0'; When OTHERS => segment(0) <='1'; segment(1) <='1'; segment(2) <='1'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; end case; When "1011" => if product > "00001001" and product < "00010100" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; elsif product > "00010011"  and product < "00011110" then segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; elsif product > "00011101" and product < "00101000" then segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; elsif product > "00100111" and product < "00110010" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; elsif product > "00110001" and product < "00111100" then segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; elsif product > "00111011" and product < "01000110" then segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; elsif product > "01000101" and product < "01010000" then segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; elsif product > "01001111" and product < "01011010" then segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; elsif product > "01011001" and product < "01100100" then segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; elsif product > "01101101" and product < "01111000" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; elsif product > "01110111" and product < "10000010" then segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; elsif product > "10000001" and product < "10001100" then segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='1'; segment(6) <='0'; elsif product > "10001011" and product < "10010110" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; elsif product > "10010101" and product < "10100000" then segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='1'; segment(5) <='0'; segment(6) <='0'; elsif product > "10011111" and product < "10101010" then segment(0) <='0'; segment(1) <='1'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; elsif product > "10101001" and product < "10110100" then segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; elsif product > "10110011" and product < "10111110" then segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='0'; --				elsif product > "10111101" and product < "11001000 " then --					segment(0) <='0'; --					segment(1) <='0'; --					segment(2) <='0'; --					segment(3) <='0'; --					segment(4) <='1'; --					segment(5) <='0'; --					segment(6) <='0'; elsif product > "11010001" and product < "11011100" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; elsif product > "10111101" and product < "11100010" then segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; else segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; end if; When "1101" => if product > "01100011" and product < "11001000" then segment(0) <='1'; segment(1) <='0'; segment(2) <='0'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; elsif product > "11000111" then segment(0) <='0'; segment(1) <='0'; segment(2) <='1'; segment(3) <='0'; segment(4) <='0'; segment(5) <='1'; segment(6) <='0'; else segment(0) <='0'; segment(1) <='0'; segment(2) <='0'; segment(3) <='0'; segment(4) <='0'; segment(5) <='0'; segment(6) <='1'; end if; When OTHERS => segment(0) <='1'; segment(1) <='1'; segment(2) <='1'; segment(3) <='1'; segment(4) <='1'; segment(5) <='1'; segment(6) <='1'; end case; end if; end process; end Behavioral;

*********************Blinking LEDs***************************

Here are the videos of showing the execution of the codes above:



You can also find out how to build a 4-state Mealy ASM here

Operate
presentation

Trace History In the early 70's, personal computers and calculators were both born. Calculators focused in math, personal computers on games. Steve Wozniak was at the center of this working for both HP and Atari in these early years. Personal computers did not do math fast or easily while calculators did math.

Build Intuition Hardware that did math gradually became part of computers through co-processors. Now all personal computers have CPU's with circuits that do math. The goal of this project is to show how circuits (not programs) multiply.

Comparing the middle to the left, two things happened: shifting right instead of left and splitting the shift/add steps into two separate steps. The enabled:
 * observation of a three step pattern:
 * add/don't add
 * temp subtotal
 * shift right (don't have to count how many)


 * dual use of the left four bits .. which start off totally red ... and the red is shifted out after it is no longer useful
 * left most red bit determines whether add or don't add
 * a ninth bit to the left has to be added in case the adding results in a carry or 5th most significant digit


 * 1) press the joystick until the left most LED's are off and '---' is displayed
 * 2) flick the eight switches to form two binary numbers
 * 3) press the joystick and watch the adding and shifting
 * 4) when a number is displayed, then the answer has been computed and is in binary in the LED's The following presentation shows how to use the ASM to build the multiplier: Binary Multiplier.pdf

Demo
on only 3 digits because the maximum number we can have is 225 when all the switches are up.
 * Presentation
 * Video of how multiplying works when using the IEEE VHDL arith.all library.
 * Here is the demo of the multiplication using the papilio. we start with everything at zero, the four left most switches control the two leftmost digits(A value from 0 to 15 in decimal is displayed), and the four rightmost switches control the two rightmost digits(A value from 0-15 is also displayed here), once the combination is entered, the joystick is pressed, and the result from the multiplication is shown.

Next Steps
Just one piece of this circuit has been built and then it was redesigned. The current design needs to be built.