Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use VHDL to design an arithmetic circuit with sign-magnitude format Design and s

ID: 3812837 • Letter: U

Question

Use VHDL to design an arithmetic circuit with sign-magnitude format Design and simulate the circuit in 5.1. The sign-magnitude format is an alternative way to represent a signed number. It is used for floating-point representation. In this format, the MSB is the sign bit (0 for positive and 1 for negative) and the remaining bits represent the magnitude. For example, in 5-bit sign-magnitude format, "01001" represents +9 and "11001" represents-9. The project designs a circuit that can perform addition and subtraction for numbers in sign-magnitude format. The inputs of the circuit are a, b: the two 5-bit input operands in sign-magnitude format. add: a 1-bit signal indicating the type of operation, in which 0 is for addition (i.e., a+b) and 1 is for subtraction (i.e.. a-b). The output of the circuit is r: the 5-bit result in sign-magnitude format. (a) Derive the top-level diagram of the circuit. The diagram should have about 5 to 10 blocks (which can be adder, subtractor, mu x, comparator, and basic logic gates) (b) Derive the VHDL code according to the top-level diagram. Following entity declaration should be used. The VHDL code needs to be properly commented to indicate the corresponding relationship between the VHDL statements and the blocks in the previous block diagram. entity sm_arith is port (a, b: in std_logic_vector(4 downto 0); add: in std_logic; r: out std_logic_vector (4 downto 0)); end sm_arith; (c) Start a project in Altera Qurtus II software and create the VHDL file (with extension of

Explanation / Answer

import java.io.*;
class LRU   
}
return temp;
}
public static void main(String args[])throws IOException the dimensions of the array”);
int n=Integer.parseInt(br.readLine());
int a[]=new int[n];
int flag[]=new int[n];
System.out.println(“enter the elements”);
for(int i=0;i<n;i++)
int b[]=new int[3];
int c[]=new int[3];
for(int i=0;i<3;i++)
for(int i=0;i<n;i++)
}
if (flag[i]==0 && b[2]==-1)   
}
}   
if(flag[i]==0)
}
System.out.println(“no of hits”+hit);
System.out.println(“no of faults”+faults);
System.out.println(“hit ratio”+(hit*100)/(hit+faults));
}
}