I am working on a simple sign extender in Verilog for a processor that I create for computer architecture.
Here's what I have so far: [EDIT: slightly changed the select statement]
`timescale 1ns / 1ps module SignExtender( CLK, extend, extended ); input[7:0] extend; input CLK; output[15:0] extended; reg[15:0] extended; wire[7:0] extend; always begin while (CLK == 1) extended[7:0] = extend[7:0]; extended[15:8] = {8{extend[7]}}; end endmodule
I added that while (CLK == 1) thinks this will solve my problem, and I believe this is an infinite loop. When I try to verify this in iSim, the circuit is never initialized.
I also tried removing the copy syntax and just doing extended [8] = extend [7] etc. for [8] - [15], but the same result arises, so I'm sure that the innermost syntax is correct.
Here's the test file:
`timescale 1ns / 1ps module SignExtender_testbench0;
Any ideas how I can do this successfully?
verilog vlsi
Alex mullans
source share