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

More Related Content

What's hot

All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
Delays in verilog
Delays in verilogDelays in verilog
Delays in verilogJITU MISTRY
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDFUR11EC098
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.Omkar Rane
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptxVandanaPagar1
 
Verilog data types -For beginners
Verilog data types -For beginnersVerilog data types -For beginners
Verilog data types -For beginnersDr.YNM
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controllerTech_MX
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorVikas Gupta
 
Binary multipliers
Binary multipliersBinary multipliers
Binary multipliersSyed Saeed
 
Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder Bharti Airtel Ltd.
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effectsPeriyanayagiS
 

What's hot (20)

Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
Delays in verilog
Delays in verilogDelays in verilog
Delays in verilog
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
Behavioral modelling in VHDL
Behavioral modelling in VHDLBehavioral modelling in VHDL
Behavioral modelling in VHDL
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptx
 
Verilog data types -For beginners
Verilog data types -For beginnersVerilog data types -For beginners
Verilog data types -For beginners
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessor
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
 
8051 timer counter
8051 timer counter8051 timer counter
8051 timer counter
 
Binary multipliers
Binary multipliersBinary multipliers
Binary multipliers
 
Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder
 
VERILOG CODE FOR Adder
VERILOG CODE FOR AdderVERILOG CODE FOR Adder
VERILOG CODE FOR Adder
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 

Viewers also liked

Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesRicardo Castro
 
Dutch media landscape 2015 Q4 update by Starcom
Dutch media landscape 2015 Q4 update by Starcom Dutch media landscape 2015 Q4 update by Starcom
Dutch media landscape 2015 Q4 update by Starcom starcomNL
 
Ea conference st albert feb 2014
Ea conference  st albert feb 2014Ea conference  st albert feb 2014
Ea conference st albert feb 2014tobylscott
 
Aspire one series service guide
Aspire one series service guideAspire one series service guide
Aspire one series service guideSetyo Prasadja
 
fdgdfgdfg
fdgdfgdfgfdgdfgdfg
fdgdfgdfgsotirov
 
CV Roy Basoeki
CV Roy BasoekiCV Roy Basoeki
CV Roy Basoekitime4web
 
Filtros de cabine
Filtros de cabineFiltros de cabine
Filtros de cabinetuliovmg1
 
Configure h base hadoop and hbase client
Configure h base hadoop and hbase clientConfigure h base hadoop and hbase client
Configure h base hadoop and hbase clientShashwat Shriparv
 
Monografia fic
Monografia ficMonografia fic
Monografia ficromercen
 
Chafer, 52 Bible Doctines: Man and sin part 2
Chafer, 52 Bible Doctines: Man and sin part 2Chafer, 52 Bible Doctines: Man and sin part 2
Chafer, 52 Bible Doctines: Man and sin part 2Richard Chamberlain
 
Miquel Martí i Pol
Miquel Martí i PolMiquel Martí i Pol
Miquel Martí i PolQuim Civil
 
Microorganisms
MicroorganismsMicroorganisms
Microorganismssunilbhil
 

Viewers also liked (20)

Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
 
Dutch media landscape 2015 Q4 update by Starcom
Dutch media landscape 2015 Q4 update by Starcom Dutch media landscape 2015 Q4 update by Starcom
Dutch media landscape 2015 Q4 update by Starcom
 
Ea conference st albert feb 2014
Ea conference  st albert feb 2014Ea conference  st albert feb 2014
Ea conference st albert feb 2014
 
Aspire one series service guide
Aspire one series service guideAspire one series service guide
Aspire one series service guide
 
fdgdfgdfg
fdgdfgdfgfdgdfgdfg
fdgdfgdfg
 
CV Roy Basoeki
CV Roy BasoekiCV Roy Basoeki
CV Roy Basoeki
 
Hwswb
HwswbHwswb
Hwswb
 
Lulusan SMK PI class of 2014
Lulusan SMK PI class of 2014Lulusan SMK PI class of 2014
Lulusan SMK PI class of 2014
 
Filtros de cabine
Filtros de cabineFiltros de cabine
Filtros de cabine
 
Ususnmptn2011
Ususnmptn2011Ususnmptn2011
Ususnmptn2011
 
Creando Enlaces a Prueba de Penguin
Creando Enlaces a Prueba de PenguinCreando Enlaces a Prueba de Penguin
Creando Enlaces a Prueba de Penguin
 
Zhuangzi
ZhuangziZhuangzi
Zhuangzi
 
C++ Chapter I
C++ Chapter IC++ Chapter I
C++ Chapter I
 
Configure h base hadoop and hbase client
Configure h base hadoop and hbase clientConfigure h base hadoop and hbase client
Configure h base hadoop and hbase client
 
Rules around us
Rules around usRules around us
Rules around us
 
Monografia fic
Monografia ficMonografia fic
Monografia fic
 
Yg Ini 1
Yg Ini 1Yg Ini 1
Yg Ini 1
 
Chafer, 52 Bible Doctines: Man and sin part 2
Chafer, 52 Bible Doctines: Man and sin part 2Chafer, 52 Bible Doctines: Man and sin part 2
Chafer, 52 Bible Doctines: Man and sin part 2
 
Miquel Martí i Pol
Miquel Martí i PolMiquel Martí i Pol
Miquel Martí i Pol
 
Microorganisms
MicroorganismsMicroorganisms
Microorganisms
 

More from Rakesh kumar jha

More from Rakesh kumar jha (8)

matlab code of shifting and folding of two sequences
matlab code of shifting and folding of two sequencesmatlab code of shifting and folding of two sequences
matlab code of shifting and folding of two sequences
 
MATLAB CODE OF Shifting sequence
MATLAB  CODE  OF Shifting sequenceMATLAB  CODE  OF Shifting sequence
MATLAB CODE OF Shifting sequence
 
Matlab implementation of fast fourier transform
Matlab implementation of  fast fourier transformMatlab implementation of  fast fourier transform
Matlab implementation of fast fourier transform
 
Verilog code for decoder
Verilog code for decoderVerilog code for decoder
Verilog code for decoder
 
Reversible code converter
Reversible code converterReversible code converter
Reversible code converter
 
Ujt
UjtUjt
Ujt
 
Pin diode
Pin diodePin diode
Pin diode
 
Schottky diode
Schottky diodeSchottky diode
Schottky diode
 

Verilog coding of demux 8 x1

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