Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help on changing clock within program

Status
Not open for further replies.

jbs87

Newbie level 6
Joined
Oct 23, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,389
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?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top