May 21, 2012, 02:20:43 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
International Electronics and Technology Forum
>
Digital Electronics
>
PLD SPLD GAL CPLD FPGA
>
Help with multiplexer in verilog?
Pages: [
1
]
« previous
next »
Print
Author
Topic: Help with multiplexer in verilog? (Read 222 times)
Evil_Duck
Newbie
Posts: 3
Help with multiplexer in verilog?
«
on:
August 09, 2011, 12:02:14 AM »
I am trying to implement a 2-1 multiplexer on my FPGA development board. So far I'm puzzled as to why what I have tried has not worked. I have checked all my pin assignments and they are correct.
My inputs A, B and Sel are connected to switches and output Z connected to an LED. All that happens when I configure the FPGA is that the LED lights up and nothing happens when I switch my inputs.
module multiplexer(input A, B, Sel,
output reg Z);
always@(*)begin
case(Sel)
1'b0: Z = A;
1'b1: Z = B;
default: Z = 1'b0;
endcase
end
endmodule
module multiplexer(input A, B, Sel,
output Z);
assign Z = (~Sel & A) | ( Sel & A);
endmodule
module multiplexer(input A, B, Sel,
output Z);
assign Z = Sel? B:A;
endmodule
module multiplexer(input A, B, Sel,
output reg Z);
always@(*)begin
if(!Sel)
Z = A;
else if(Sel)
Z = B;
else
Z = 1'b0;
end
endmodule
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Electrotechlab Primer
-----------------------------
=> About Electrotechlab
=> Electronics News
=> Consumer Electronics and Gadgets
=> General Technology
=> Computers and Internet
-----------------------------
Analog and Mixed Signal
-----------------------------
=> Electricity and Analog Electronics
=> Signal Conversion and Signal Processing
=> Industrial Electronics
-----------------------------
Digital Electronics
-----------------------------
=> Combination Logic Circuits
=> Microcontrollers
=> PLD SPLD GAL CPLD FPGA
-----------------------------
Specialization
-----------------------------
=> Wire Communications
=> Wireless Communication
=> Hi Fidelity Audio and Video
=> Mechatronics and Robotics
=> Amateur Ham Radio
-----------------------------
Electrical Electronics Repair
-----------------------------
=> Test Equipment and Instrumentation
=> General Electrical and Electronics Repair
=> Personal Computer and Peripherals
-----------------------------
Resources
-----------------------------
=> Computer Programming
=> PCB Design
=> Datasheets Manuals Ebooks and Links
=> Electronic Projects Design and Ideas
-----------------------------
General Forum
-----------------------------
=> Anything Under The Sun
=> Arts Culture and Lifestyle
=> Sports Games and Entertainment
=> General Science
=> Health and Medicine
Loading...