![]() |
|
|
|
#1 |
|
I am writing a program for a 4bit ALU and I am trying to get the add with carry porition right. The specific case looks like
when "0001" => output <= ('0' & ALUin_a) + ( '0' & ALUin_b ) + cin; ALU_out <= output((width-1) downto 0); set <= output(width); reset <= not(output(width)); The problem is that I have coded a set reset latch to retain the cout bit and use the value of it in the cin. The latch is done in a seperate process as such: Latch : process (set, reset) begin if (set = '1' and reset = '0') then Cout <= '1'; cin <= '1'; elsif (set = '0' and reset = '1') then Cout <= '0'; cin <= '0'; end if; end process Latch; The case statement seems to be executing the 3 statements concurrently and that is making the Cin what ever is the carry for the current add operation not the previous. How can I change this so the cin that is being used is from the previous add? Any help is appreciated DPettit |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cooler Master Gladiator 600 Case | Admin | Front Page News | 0 | 07-10-2009 10:52 AM |
| ThermalTake DH 102 Home Theater Case | Admin | Front Page News | 0 | 06-12-2009 08:22 AM |
| Lian Li Tyr PC-X500 Case Review | Admin | Front Page News | 0 | 07-11-2008 09:02 PM |
| Judge: File-swapping tools are legal | Citizen Bob | DVD Video | 140 | 11-08-2006 06:42 PM |
| Enermax Phoenix Case @ ThinkComputers.org | Silverstrand | Front Page News | 0 | 10-20-2006 12:28 PM |