Carry Save Adder VHDL Code

carry save adder vhdl code

Carry save adder used to perform 3 bit addition at once. Here 3 bit input (A, B, C) is processed and converted to 2 bit output (S, C) at first stage.  At first stage result carry is not propagated through  addition operation. In order to generate carry, implemented ripple carry adder on stage 2 for carry propagation. Carry Save adder VHDL Code can be constructed by port mapping full adder VHDL Code to 2 stage adder circuit.

Carry Look Ahead Adder VHDL Code

4 bit carry look ahead adder vhdl

Carry Look Ahead Adder is fastest adder compared Ripple carry Adder. For the Purpose of carry Propagation, Carry look Ahead Adder construct Partial Full Adder, Propagation and generation Carry block. It avoid Carry propagation through each adder.

In order to implement Carry Look Ahead Adder, first implement Partial Full Adder and then Carry logic using Propagation and generation Block.

4 Bit Ripple Carry Adder VHDL Code

Ripple Carry Adder VHDL Code

Ripple Carry Adder adds 2 n-bit number plus carry input  and gives n-bit sum and a carry output. The Main operation of Ripple Carry Adder is it ripple the each carry output to carry input of next single bit addition. Each single bit addition is performed with full Adder operation (A, B, Cin) input and (Sum, Cout) output.  The 4-bit Ripple Carry Adder VHDL Code can be Easily Constructed by Port Mapping 4 Full Adder. The following figure represent the 4-bit ripple carry adder.

VHDL Code for 4-bit Ring Counter and Johnson Counter

VHDL Ring Counter 4 bit

Ring Counter very similar to shift register. At each clock pulse, data at each flipflop shifted to next flipflop with last output is feed back to the input of first flipflop. Also the first flop is set to ‘1’ at the reset state. so it shift bit ‘1’ to next flipflop for each clock input and repeat the sequence as shown below.

VHDL Code for 2 to 4 decoder

Binary decoder has n-bit input lines and 2 power n output lines. It can be 2-to-4, 3-to-8 and 4-to-16 line configurations. Binary decoder can be easily constructed using basic logic gates. VHDL Code of 2 to 4 decoder can be easily implemented with structural and behavioral modelling.

×

Chat with us for queries on the EDGE FPGA kit

×