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.

I Need Your Guidance in FPGA !

Status
Not open for further replies.

Kynix

Banned
Joined
Jun 27, 2016
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
0
Hello~everyone:cool:

I’m a beginner in the FPGA. The past days I have learned the language of Verilog HDL and digital circuit. I have changed the following code and I am get into hot water. The conclusion is about the usage of Parameter and assign. In the process of learning Verilog,I haven’t seen the usage of some keywords while they are just understood by some examples. As a result, the problems come up when using. Anybody can teach me ? I will resign myself to your guidance.

Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module test_Change1 (A, B, C, L);
 
input A, B, C;
 
output L;
 
reg a = 1'b1, b = 1'b1, c = 1'b1;
 
//assign a = 1'b1;
//assign b = 1'b1;
//assign c = 1'b1;
 
//parameter a, b, c;
 
always @(posedge A)
* * * * a = 1'b0;
always @(posedge B)
* * * * b = 1'b0;
always @(posedge C)
* * * * c = 1'b0;
 
assign L = (a&b)|(a&c)|(b&c);
endmodule



Your help will be appreciated!Thanks a lot.:p
 
Last edited by a moderator:

If you've somethings declared as a reg, then you have to give it values inside a procedure ( always or initial blocks ).

I don't seen any clock in your design so a = 1'b0; looks ok to me. But where are your begin ..... end for the always blocks?

The output signal L, defaults to wire output type so assign L = (a&b)|(a&c)|(b&c); is also ok.

What is the problem you are facing? What does your compiler say?
 

But where are your begin ..... end for the always blocks?
No problem to have a single statement after always@().

The design has multiple drivers for a,b and c when using assign. If useful at all, the regs can be legally preset in an initial block. The construct translates to a power-on preset, if available in the respective FPGA hardware. The initializer expressions in the reg definition may be already recognized as power-on preset.

Better to provide an asynchronous preset signal to the always blocks.

Besides fixing semantic/syntax errors, what's the purpose of the design?

- - - Updated - - -

It makes no difference in this case, but you should generally use non-blocking "<=" assignments for register logic.
 
  • Like
Reactions: Kynix

    Kynix

    Points: 2
    Helpful Answer Positive Rating
I'm not entirely certain this is intended to infer registers. I suspect the assigns were intended to be initial -- at least for a first sim. After which there would be more questions.
 
  • Like
Reactions: Kynix

    Kynix

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top