jbs87
Newbie level 6
module lcd(leds,ssegsel, EN, clear, clear_value, clk, out,out1,a1);
output [1:7] leds ;
output [3:0] ssegsel;
reg [1:7] leds;
wire [3:0] ssegsel;
input a1, EN, clear, clear_value, clk ;
output out,out1;
reg [63:0] out;
wire [1:0] a1;
wire CLK125khz, clk1;
assign clk1=clk;
// wire CLK500Khz,CLK250Khz,CLK125Khz;
CLK_DIV16 CLK_DIV16_inst( // CoolRunner-II primitive
.CLKDV(CLK125khz), // Divided clock output
.CLKIN(clk) // Clock input
);
always@(posedge clk1)
begin
if (a1==2'b00)
begin
assign clk1 = CLK125khz;
out <= 16'b0000000000000001*16'b0000000000000001;
end
Can I change the clock within an always block? Initially I assign clk to clk1 since you cannot modify inputs. I then use clk1 as the clock within the always block, if a1=00, I assign clk125khz to clk1.
Basically i want to change the value of the clock within the always block as it is running. Is it possible? If not, are there any alternatives?
output [1:7] leds ;
output [3:0] ssegsel;
reg [1:7] leds;
wire [3:0] ssegsel;
input a1, EN, clear, clear_value, clk ;
output out,out1;
reg [63:0] out;
wire [1:0] a1;
wire CLK125khz, clk1;
assign clk1=clk;
// wire CLK500Khz,CLK250Khz,CLK125Khz;
CLK_DIV16 CLK_DIV16_inst( // CoolRunner-II primitive
.CLKDV(CLK125khz), // Divided clock output
.CLKIN(clk) // Clock input
);
always@(posedge clk1)
begin
if (a1==2'b00)
begin
assign clk1 = CLK125khz;
out <= 16'b0000000000000001*16'b0000000000000001;
end
Can I change the clock within an always block? Initially I assign clk to clk1 since you cannot modify inputs. I then use clk1 as the clock within the always block, if a1=00, I assign clk125khz to clk1.
Basically i want to change the value of the clock within the always block as it is running. Is it possible? If not, are there any alternatives?