Question: Write a verilog code that implements the following funtions: E = A / 2 ^ i + B * 2 ^ j F = E

Write a verilog code that implements the following funtions:
E = A /2^i+ B *2^j
F = E * C
Where:
A, B, C and E are 8-bit unsigned numbers
i and j are 3-bit unsigned numbers.
F is 16-bit unsigned number
Design Specification:
Implement the design using Verilog language. Do not use the following math operations:
-,+,*,/, shift/rotate (>>,<<). You need to implement them yourself.
The top design name is mydesign and the port definition is illustrated below. You must
use the below testbench and template in your design.
timescale 1ns/100ps
module mydesign_tb;
reg [7:0] A;
reg [7:0] B;
reg [7:0] C;
reg [2:0] i, j;
wire [15:0] F;
// Mydesign one round in hardware
mydesign mydesign (
.A (A),
.B (B),
.C (C),
.i (i),
.j (j),
.F (F)
);
initial begin
$monitor ("(values are in HEX) A=%h B=%h C=%h i=%h j=%h F=%h", A, B, C,
i, j, F);
A=8'h06; B=8'h06; C=8'h06 ; i=3'h1; j=3'h1;
#10;
A=8'h01; B=8'h01; C=8'h01 ; i=3'h1; j=3'h1;
#10;
A=8'hFF; B=8'hFF; C=8'hFF ; i=3'h7; j=3'h7;
#10;
A=8'hFF; B=8'hFF; C=8'hFF ; i=3'h0; j=3'h0;
#10;
$stop;
end
endmodul
Use your own choice of multiplier algorithm to implement the multiplier.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!