Question: Need this to do signed numbers it currently does unsigned. It is in system verilog. Also can't use 'signed' function. module Multiplier ( input Clock,
Need this to do signed numbers it currently does unsigned. It is in system verilog. Also can't use 'signed' function.
module Multiplier
input Clock, Reset, declare inputs
input :Multipicand,
input :Multiplier
output :Productdeclare outputs
output Halt;
reg :RegQ RegM; Q and M registers
reg :RegA; A register
reg :count; bit iteration counter
wire coStart Add, shift;
assign Product RegA:RegQ; product A:Q
bit counter for #iterations
always @posedge Clock
if Start Count b; clear in start state
else if shift Count mathrmCount ; increment in shift state
assign CO Count & Count ; detect count
Multplicand register load only
always @posedge clock
if Start RegM Multiplicand; load in start state
Multiplier register loadshift
always @posedge Clock
if Start RegQ Multiplier; load in start state
else if shift RegQ RegARegQ:; shift in shift state
Accumulator register clearload shift
always @posedge Clock
if Start RegA b; clear in start state
else if Add RegA RegA RegM; oad in Add state
Instantiate controller module
Multcontrol CtrClockReset RegQCStart Add, Shift, Halt;
endmodule
module MultContro
input Clock, Reset, QOCOdeclare inputs
output Start, Add, shift, Hat; declare outputs
reg :state; five states one hot one flipflop per state
onehot state assignments for five states
parameter startsbTestSbAddsbshiftsb
reg :Counter; bit counter for # of algorithm iterations
state transitions on positive edge of Clock or Resets
always @posedge Clock, posedge Reset
if Resetstate Starts; enter starts state on Reset
else
case state
Starts: state Tests; starts to Tests
TestS: if QOstate AddS; TestS to AddS if Q
else state shifts; Tests to shifts if Q
Adds: state shifts; Adds to shifts
Shifts: if COstate Halts; shifts to Halts if C
else state Tests; shifts to Tests if c
Halts: state Halts; stay in Halts
endcase
Moore model activate one output per state
assign Start state; Startin state Starts, else
assign Add state; Addin state Adds, else
assign shift state; shiftin state shifts, else
assign Halt state; Haltin state Halts, else
endmodule
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
