SlideShare a Scribd company logo
2
Most read
Verilog coding of MUX 8X1using if else statement
module mux(d, sel, z);
input [8:0] d;
input [2:0] sel;
output z;
reg z ;
always @( d or sel)
begin
if (sel==3'b000)
z= d[0];
else if(sel==3'b001)
z= d[1];
else if(sel==3'b010)
z= d[2];
else if(sel==3'b011)
z= d[3];
else if(sel==3'b100)
z= d[4];
else if(sel==3'b101)
z= d[5];
else if(sel==3'b110)
z= d[6];
else if(sel==3'b111)
z= d[7];
end
endmodule
verilog coding of 8x1 mux using case statement
module mux(d, sel, z);
input [8:0] d;
input [2:0] sel;
output z;
reg z ;
always @( d or sel)
begin
case(sel)
3'b000 : z=d[0];
3'b001 : z=d[1];
3'b010 : z=d[2];
3'b011 : z=d[3];
3'b100 : z=d[4];
3'b101 : z=d[5];
3'b110 : z=d[6];
3'b111 : z=d[7];
endcase
end
endmodule

More Related Content

PPTX
Verilog Test Bench
PPT
Chapter 03 cyclic codes
PPTX
Finite state machines
PPTX
Divide by N clock
PDF
Verilog coding of demux 8 x1
PDF
verilog code for logic gates
PPT
Pass Transistor Logic
PPTX
Vlsi testing
Verilog Test Bench
Chapter 03 cyclic codes
Finite state machines
Divide by N clock
Verilog coding of demux 8 x1
verilog code for logic gates
Pass Transistor Logic
Vlsi testing

What's hot (20)

PDF
Verilog full adder in dataflow & gate level modelling style.
PDF
VLSI Fresher Resume
PDF
Smart traffic light controller using verilog
DOCX
Embedded system for traffic light control
PDF
Decimation and Interpolation
PDF
BUilt-In-Self-Test for VLSI Design
PDF
Main project report on GSM BASED WIRELESS NOTICE BOARD
PPTX
PULSE WIDTH MODULATION &DEMODULATION
PPTX
Strowger Switching System
PPSX
VLSI Testing Techniques
PPTX
Overlap Add, Overlap Save(digital signal processing)
PPTX
DIgital clock using verilog
PPTX
System verilog coverage
PPTX
All About VLSI In PPT
PDF
Synchronous and asynchronous clock
PDF
Verilog Tasks & Functions
PDF
Design and implementation of 32 bit alu using verilog
PPT
Decimation in time and frequency
PPTX
Ec 2401 wireless communication unit 2
Verilog full adder in dataflow & gate level modelling style.
VLSI Fresher Resume
Smart traffic light controller using verilog
Embedded system for traffic light control
Decimation and Interpolation
BUilt-In-Self-Test for VLSI Design
Main project report on GSM BASED WIRELESS NOTICE BOARD
PULSE WIDTH MODULATION &DEMODULATION
Strowger Switching System
VLSI Testing Techniques
Overlap Add, Overlap Save(digital signal processing)
DIgital clock using verilog
System verilog coverage
All About VLSI In PPT
Synchronous and asynchronous clock
Verilog Tasks & Functions
Design and implementation of 32 bit alu using verilog
Decimation in time and frequency
Ec 2401 wireless communication unit 2
Ad

More from Rakesh kumar jha (9)

PDF
matlab code of shifting and folding of two sequences
PDF
MATLAB CODE OF Shifting sequence
PDF
Matlab implementation of fast fourier transform
PDF
Verilog code for decoder
PDF
VERILOG CODE FOR Adder
PDF
Reversible code converter
PPTX
Pin diode
PPTX
Schottky diode
matlab code of shifting and folding of two sequences
MATLAB CODE OF Shifting sequence
Matlab implementation of fast fourier transform
Verilog code for decoder
VERILOG CODE FOR Adder
Reversible code converter
Pin diode
Schottky diode
Ad

Verilog coding of mux 8 x1

  • 1. Verilog coding of MUX 8X1using if else statement module mux(d, sel, z); input [8:0] d; input [2:0] sel; output z; reg z ; always @( d or sel) begin if (sel==3'b000) z= d[0]; else if(sel==3'b001) z= d[1]; else if(sel==3'b010) z= d[2]; else if(sel==3'b011) z= d[3]; else if(sel==3'b100) z= d[4]; else if(sel==3'b101) z= d[5]; else if(sel==3'b110) z= d[6]; else if(sel==3'b111) z= d[7]; end endmodule
  • 2. verilog coding of 8x1 mux using case statement module mux(d, sel, z); input [8:0] d; input [2:0] sel; output z; reg z ; always @( d or sel) begin case(sel) 3'b000 : z=d[0]; 3'b001 : z=d[1]; 3'b010 : z=d[2]; 3'b011 : z=d[3]; 3'b100 : z=d[4]; 3'b101 : z=d[5]; 3'b110 : z=d[6]; 3'b111 : z=d[7]; endcase end endmodule