Project P4 on arithmetic operations for 2C integer numbers 
P_Ch1: 8bit 2C adder, subtractor and comparator
How fast is the circuit calculating? (gatelevel VHDL simulations)
1. Specifications
Perform several example 2C operations (using both positive and negative integers) on the circuit in Fig. 1 to verify whether you understand how it works. Calculate as well the zero (Z), overflow (OV), and sign (S) indicators.
1. Design an 8bit adder and subtractor in two's complement with zero(Z), sign (S) and overflow (OV) flags using VHDL and a multiple file hierarchical structural approach (plan C2). Discus the symbol (below in Fig 1) , the truth table and the timing diagram of this circuit. How long is the truth table?
Fig. 1. Symbol of an 8bit 2C adder/subtractor. Run this project solved in Proteus 8bit 2C adder and subtractor and try to visualise better how operates and how the two's complemented data looks like. 
2. Design an 8bit adder, subtractor and comparator for integer numbers. As shown in Fig. 2, the circuit in Fig. 1 is expanded with the new feature of 2C number comparison, therefore 3 additional outputs are required: GT (greater than) to detect when A > B, EQ (equal to) to detect when A = B, and LT (less than) to detect when A < B.
Fig. 2. Symbol of the project. The input operants A(7..0), B(7..0) and the results R(7..0) are 8bit integers expressed in 2C. 
3. Circuit's maximum processing speed. Once the circuit works and is tested functionally as usual, perform a gatelevel simulation to determine the circuit maximum speed of operation. Below you've got some materials to study about gate delays. This is the VHDL design flow (pdf, Visio) where you see that the gatelevel simulation is the 5th design step to save time before making real measurements in the lab uploading the configuration file to the prototyping board. For instance, two different experiments can be carried out:

Learning materials:
 Symbols of the most commom arithmetic blocks. (Visio)
 Let's learn how to perform basic operations using binary number system: addition, subtraction, comparison, multiplication, etc. Solve exercises on arithmetic operations like in the problem 4.1 in our collection.
 These are a pair of P3 tutorials on the design of the same expandable 1bit comparator using a plan A (Comp_1bit ) or a plan C2 (Comp_1bit ) either of which can be used as a building block for the 8bit comparator (Comp_8bit) and later on for the 8bit two's complement comparator (Int_comp_8bit). Here you are some notes (1) and (2) about it.
 LAB#5 Notes in this lesson about propagation delays, computing speed calculations and gatelevel simulations including a tutorial.
 This is an ALU 74AS181, and this is a carry lookahead generator 74HCT182.
2. Planning
Structural design. Thus, as you've seen in P3, let's plan the following separated projects, and then combine them all:
1. Design flow steps: 1)  2)  3)  4): Study how the overflow logic (OV) works and why it is designed so (these notes can suit you). Study how the zero flag (Z) works. Is it the same as in the Adder_8bit? Design the structure of an 8bit adder/subtractor using components and signals as for example in this plan. Use any hierarchical example or tutorial project to copy and adapt to translate to VHDL and get the components from previous projects. Count and name all the VHDL files involved in the project. Name the folder to keep all the project files:
<disk>/CSD/P4/Int_add_subt_8bit/(files)
2. Design flow steps: 1)  2)  3)  4): Design the structure of an 8bit adder/subtractor/comparator (Int_add_subt_comp_8bit) using components and signals. This is essentially, designing first the Comp_8bit and then the 8bit 2C comparator (Int_comp_8bit) and placing it in the top schematic along with the Int_add_subt_8bit.
<disk>/CSD/P4/Int_add_subt_comp_8bit/(files)
3. Gatelevel simulations:
Add the gatelevel simulation as the last step in the design flow. So that you can perform measurements of the circuits' speed. How many millions of operations per second (Mops) can perform the Int_add_subt_8bit?
1. Once you have completed the planning of the project in Fig. 1, you can start the synthesis process. Write down the VHDL files translating the plans above using components and signals modifying a convenient seed circuit. For instance, these circuits may suit you: Adder_1bit, Adder_4bit, Adder_8bit, Int_add_subt_8bit. You see that the 4bit and 8bit adders are slightly modified because the overflow flag OV is generated using the most significant carries.
Run the EDA tool to synthesise the circuit. Print and comment the RTL schematic. Is it like what you had sketched in the plan?
2. And repeat the design process for the Int_add_subt_comp_8bit.vhd project in Fig. 2.
4. Testing (functional simulation)
1. From the initial timing diagram sketch, Convert it into a VHDL testbench like in this file Int_add_subt_8bit_tb.vhd writing the inputs activity and the Min_Pulse constant in the template produced by the EDA tool. Surely, it's going to be a good idea the adaptation of the test vectors used in the 8bit adder. Use positive and negative numbers as inputs to the circuit. Check overflow and zero situations.
Run the EDA VHDL simulator and demonstrate how the circuit works adding comments to the printed sheet of paper containing the waveforms.

Fig. 3. Example test with some input vectors. A, B and R are 2C numbers. 
2. And repeat for the project 8bit adder subtractor comparator in Fig.2.
5. Testing (gatelevel simulation)
Run a gatelevel simulation to measure the worst case delay and the maximum speed of operation (or highest computation speed) of the synthesised circuit.
Perform a simulation to show that the circuit cannot produce correct results when the Min_Pulse constant is less that the worst case delay.

Fig. 4. Example waveform for the Int_add_subt_8bit showing how a given input vector is computed over time generating wrong results until all signals have propagated through the circuit. Picture taken from the tutorial. 
6. Report
Project report starting with the template sheets of paper, scanned figures, file listings, docx, pptx, or any other resources. Take care of the computer folders where the project are archived.
7. Prototyping
Use training boards and perform laboratory measurements to verify how the circuit works.
Other similar projects on arithmetic combinational circuits
 This is an example of an structural hierarchical 8bit 2C multiplier (Int_mult_8bit) build in Proteus using an unsigned 8bit multiplier (Mult_8bit) and other blocks to organise the sign algorithm for integer numbers. An input N allows the selection of data to be radix 2 or 2C. This problem is interesting because puts at the limits our plan C2. The networks of components is too complex to be described in a text file. Hint: if this problem has to be solved in VHDL using EDA tools, perhaps is better to describe the Mult_8bit using a behavioural approach (plan B) instead of this complicated plan C2 architecture.
 Here you are many HADES Java applets on arithmetic circuits.
 Parity generators, multipliers, dividers, ones counter, code converters, etc. These pair of tutorials on the design of 4bit and 8bit ones counters also include gatelevel simulations.
 A summary of projects proposed in the P4 to study basic standard arithmetic circuits.
 There are hundreds of web pages and videos over the internet on binary arithmetic circuits. And every book on the subject has several chapters on arithmetic circuits because they are fundamental blocks of computers.
Fig. 5. A dedicated processor representing the Arithmetic and Logic Unit (ALU) as the core of the datapath structure. Source: Hwang, E., Digital Logic and Microprocessor Design with VHDL, CLEngineering, 2005. 
Examples of midterm exams (Exa_1)
 Exams, questions, problems and projects.