Solve this Operation (Code Converter) This operation will be activated after the
ID: 3582974 • Letter: S
Question
Solve this Operation (Code Converter) This operation will be activated after the user enters the value of 01 for the control bits c1 c0. The value (a2 a1 a0 b2) is converted from binary to another coding system using the designed unit. The coding system to be implemented is 7421 code described below. The output is to be displayed on the 7-segment display. Note: This part must be done using Verilog. Finally a symbol is created, and added to the main design. For the design part, ROM will not be accepted as a design. For the display part you can use ROM. All LED’s must be set to OFF. *Display 7421 Code: This is a weighted code, its weights are 7, 4, 2 and 1. A decimal number is represented in 4-bit form and the total four bits weight is 7 + 4 + 2 + 1 = 14. Hence the 7421 code represents the decimal numbers from 0 to 14. Example: The bit assignment 1001 will be converted to 1x7+0x4+0x2+1x1 = 8 Solve this Operation (Code Converter) This operation will be activated after the user enters the value of 01 for the control bits c1 c0. The value (a2 a1 a0 b2) is converted from binary to another coding system using the designed unit. The coding system to be implemented is 7421 code described below. The output is to be displayed on the 7-segment display. Note: This part must be done using Verilog. Finally a symbol is created, and added to the main design. For the design part, ROM will not be accepted as a design. For the display part you can use ROM. All LED’s must be set to OFF. *Display 7421 Code: This is a weighted code, its weights are 7, 4, 2 and 1. A decimal number is represented in 4-bit form and the total four bits weight is 7 + 4 + 2 + 1 = 14. Hence the 7421 code represents the decimal numbers from 0 to 14. Example: The bit assignment 1001 will be converted to 1x7+0x4+0x2+1x1 = 8 Solve this Operation (Code Converter) This operation will be activated after the user enters the value of 01 for the control bits c1 c0. The value (a2 a1 a0 b2) is converted from binary to another coding system using the designed unit. The coding system to be implemented is 7421 code described below. The output is to be displayed on the 7-segment display. Note: This part must be done using Verilog. Finally a symbol is created, and added to the main design. For the design part, ROM will not be accepted as a design. For the display part you can use ROM. All LED’s must be set to OFF. *Display 7421 Code: This is a weighted code, its weights are 7, 4, 2 and 1. A decimal number is represented in 4-bit form and the total four bits weight is 7 + 4 + 2 + 1 = 14. Hence the 7421 code represents the decimal numbers from 0 to 14. Example: The bit assignment 1001 will be converted to 1x7+0x4+0x2+1x1 = 8Explanation / Answer
Answer: See the code below:
------------------------------------
module code_display(a2,a1,a0,b2,c0,c1,r);
input a2;
input a1;
input a0;
input b2;
output c0,c1;
reg c0,c1;
output r;
reg r;
initial begin
c1=0;
c0=1;
if (c1==0 & c0==1) begin
assign r=(7*a2)+(4*a1)+(2*a0)+(1*b2);
$display(r);
end
$finish;
end
endmodule
------------------------------------