I'm new to verilog.
Active2 years, 6 months ago
$begingroup$
I'm trying to implement a 2:1 multiplexer on a FPGA development board (DE1-SOC altera) using built in switches and LEDs.
8 To 1 Multiplexer Verilog Code Gate Level
The following are the assignments that I'm using for the multiplexer, these pins are connected from the FPGA to the switches and leds on the dev board:
This is the verilog
8 To 1 Multiplexer Circuit
Its giving me an error saying that it is
expecting '.' or an identifier near '='.
How can I construct an 8 x 1 multiplexer from two 4 x 1 multiplexers with enable inputs? Multiplexer Timing. Linux serial port read. Making 16x1 multiplexer by using two 8x1 multiplexer and one 2x1. Multiplexer circuit. Can we derive all boolean functions using a 2x1 Multiplexer?
Am doing something stupid? Can you even create a 2:1 multiplexer out using switches and leds?
Thanks
lucozadelucozade
$endgroup$
2 Answers$begingroup$assign LEDR[0] = SW[0] ? SW[1] : SW[2];
Its easier to say
input [2:0] SW; too.
Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. You also have the option to opt-out of these cookies. These cookies will be stored in your browser only with your consent. Metasploit for windows. This website uses cookies to improve your experience while you navigate through the website. We also use third-party cookies that help us analyze and understand how you use this website.
What you're missing in the syntax of what you wrote is the Sean HoulihaneSean Houlihane
assign .
3,58511 gold badge1212 silver badges2424 bronze badges
$endgroup$$begingroup$
The other answer using a ternary operator is the best answer to the question. However, I figured I'd give a few more options since you said you're new to Verilog.
If-Else Statement (long form of the ternary shown).
Synthesia song download. Switch Statement (good for lots of cases).
The two solutions above are not nearly as elegant as the ternary, but are also valid ways of creating a multiplexer.
dukrdukr
$endgroup$
8 To 1 Multiplexer Using Behavioral Verilog CodeNot the answer you're looking for? Browse other questions tagged fpgaverilogmultiplexer or ask your own question.
Active6 years ago
$begingroup$
How to design an 8x1 MUX from 4x1 MUX and 2x1 MUX ?
Peyman OmidiPeyman Omidi
$endgroup$
closed as off-topic by Nick Alexeev♦, Gustavo Litovsky, placeholder, Matt Young, Dave Tweed♦Oct 5 '13 at 1:46
1 Answer8 To 1 Multiplexer Verilog Data Flow$begingroup$
simulate this circuit – Schematic created using CircuitLab
travisbartleytravisbartley
8 X 1 Mux Verilog
4,18322 gold badges1919 silver badges4141 bronze badges
$endgroup$
8 To 1 Multiplexer Circuit DiagramNot the answer you're looking for? Browse other questions tagged digital-logicmultiplexer or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |