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.

Combining 2 digital signals?

Status
Not open for further replies.

UsernameIsValid

Newbie level 3
Joined
Jun 20, 2016
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
39
How do I combine 2 digital signals into one?

Say I have signal with "pseudo-random" pulse and another signal with repeating pulse (like clock).. How do I combine those into one digital signal in verilog? Assuming they are both generated with the same clock (minimum pulse width is the same).

Just an always statement with two signals?
 

In what way do you want to "combine" them?
An or gate? AND? XOR?
 

Its an ambiguous question.

An equally ambiguous answer is that you combine them in such a way as to give the result you are seeking.
 

I think the question is more about basic Verilog logic design...

How do you use an always statement or what is an assign statement. How do you use those statements to make logic.


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Code to describe an AND gate
 
// using an always block
always @(a, b) begin // you can code this with always @* begin instead.
  out = a & b;  // note use of blocking assignment, =
end
 
// using assign
assign out = a & b;
 
// DFF following the AND gate
always @(posedge clk) begin
  out <= a & b;  // note use of non-blocking assignment, <=
end

 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top