The 4-bit adder which can do math on 4-bit integers and display on 2 7-segment LEDs.
This project is owned by Lu Xuan Minh - student of HCMUT.
Everyone can fork my project for the purpose of studying and researching.
Thank you for your viewing!
Lu Xuan Minh
Email: [email protected]
In the preceding section, we discussed how two binary bits can be added and the addition of two binary bits with a carry. In practical situations it is required to add two data each containing more than one bit. Two binary numbers each of n bits can be added by means of a full adder circuit. Consider the example that two 4-bit binary numbers B 4B 3B 2B 1 and A 4A 3A 2A 1 are to be added with a carry input C 1. This can be done by cascading four full adder circuits as shown in Figure 5.48. The least significant bits A 1, B 1, and C 1 are added to the produce sum output S 1 and carry output C 2. Carry output C 2 is then added to the next significant bits A 2 and B 2 producing sum output S 2 and carry output C 3. C 3 is then added to A 3 and B 3 and so on. Thus finally producing the four-bit sum output S 4S 3S 2S 1 and final carry output Cout. Such type of four-bit binary adder is commercially available in an IC package.
A simple adder that adds two 4-bit integers and returns the result on a hex display.
It also keeps track of the flags.
It can also subtract if the ADD/SUB is 1
ADD/SUB = 0 => add
ADD/SUB = 1 => sub