SlideShare a Scribd company logo
Verilog code for 3*8 decoder
module decoder(a,b,c, z);
input a,b,c;
output [7:0] z;
wire abar, bbar,cbar ;
assign abar =~ a;
assign bbar =~ b;
assign cbar =~ c;
assign z[0] = abar & bbar & cbar ;
assign z[1] = abar & bbar & c ;
assign z[2] = abar & b & cbar ;
assign z[3] = abar & b & c ;
assign z[4] = a & bbar & cbar ;
assign z[5] = a & bbar & c ;
assign z[6] = a & b & cbar ;
assign z[7] = a & b & c ;
endmodule
Verilog code for 3*8 decoder( alternate style of coding)
module decoder(a,b,c, z);
input a,b,c;
output [7:0] z;
wire abar, bbar,cbar ;
not inv1 ( abar, a);
not inv2 ( bbar, b);
not inv3 ( cbar, c);
and a0 ( z[0],abar,bbar,cbar);
and a1 ( z[1],abar,bbar,c);
and a2 ( z[2],abar,b,cbar);
and a3 ( z[3],abar,b,c);
and a4 ( z[4],a,bbar,cbar);
and a5 ( z[5],a,bbar,c);
and a6 ( z[6],a,b,cbar);
and a7 ( z[7],a,b,c);
endmodule
Ad

More Related Content

What's hot (20)

Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)
Dr. Swaminathan Kathirvel
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
anand hd
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...
sanjay kumar pediredla
 
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONSUNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
Dr.YNM
 
Intellectual property in vlsi
Intellectual property in vlsiIntellectual property in vlsi
Intellectual property in vlsi
Saransh Choudhary
 
Verilog
VerilogVerilog
Verilog
Mohamed Rayan
 
Switch level modeling
Switch level modelingSwitch level modeling
Switch level modeling
Devi Pradeep Podugu
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
Pushpa Yakkala
 
VERILOG CODE FOR Adder
VERILOG CODE FOR AdderVERILOG CODE FOR Adder
VERILOG CODE FOR Adder
Rakesh kumar jha
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
Bharti Airtel Ltd.
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with Examples
E2MATRIX
 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block Codes
NilaNila16
 
Basic concepts in Verilog HDL
Basic concepts in Verilog HDLBasic concepts in Verilog HDL
Basic concepts in Verilog HDL
anand hd
 
VLSI Fresher Resume
VLSI Fresher ResumeVLSI Fresher Resume
VLSI Fresher Resume
vikas kumar
 
Fsm sequence detector
Fsm sequence detector Fsm sequence detector
Fsm sequence detector
lpvasam
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
Muhammad Uzair Rasheed
 
Combinational Logic
Combinational LogicCombinational Logic
Combinational Logic
Sirat Mahmood
 
Asic design
Asic designAsic design
Asic design
Aksum Institute of Technology(AIT, @Letsgo)
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communication
asteriskbimal
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
anand hd
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...
sanjay kumar pediredla
 
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONSUNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
Dr.YNM
 
Intellectual property in vlsi
Intellectual property in vlsiIntellectual property in vlsi
Intellectual property in vlsi
Saransh Choudhary
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
Pushpa Yakkala
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
Bharti Airtel Ltd.
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with Examples
E2MATRIX
 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block Codes
NilaNila16
 
Basic concepts in Verilog HDL
Basic concepts in Verilog HDLBasic concepts in Verilog HDL
Basic concepts in Verilog HDL
anand hd
 
VLSI Fresher Resume
VLSI Fresher ResumeVLSI Fresher Resume
VLSI Fresher Resume
vikas kumar
 
Fsm sequence detector
Fsm sequence detector Fsm sequence detector
Fsm sequence detector
lpvasam
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communication
asteriskbimal
 

More from Rakesh kumar jha (10)

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
Rakesh kumar jha
 
MATLAB CODE OF Shifting sequence
MATLAB  CODE  OF Shifting sequenceMATLAB  CODE  OF Shifting sequence
MATLAB CODE OF Shifting sequence
Rakesh kumar jha
 
Matlab implementation of fast fourier transform
Matlab implementation of  fast fourier transformMatlab implementation of  fast fourier transform
Matlab implementation of fast fourier transform
Rakesh kumar jha
 
Verilog coding of demux 8 x1
Verilog coding of demux  8 x1Verilog coding of demux  8 x1
Verilog coding of demux 8 x1
Rakesh kumar jha
 
Verilog coding of mux 8 x1
Verilog coding of mux  8 x1Verilog coding of mux  8 x1
Verilog coding of mux 8 x1
Rakesh kumar jha
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
Rakesh kumar jha
 
Reversible code converter
Reversible code converterReversible code converter
Reversible code converter
Rakesh kumar jha
 
Ujt
UjtUjt
Ujt
Rakesh kumar jha
 
Pin diode
Pin diodePin diode
Pin diode
Rakesh kumar jha
 
Schottky diode
Schottky diodeSchottky diode
Schottky diode
Rakesh kumar jha
 
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
Rakesh kumar jha
 
MATLAB CODE OF Shifting sequence
MATLAB  CODE  OF Shifting sequenceMATLAB  CODE  OF Shifting sequence
MATLAB CODE OF Shifting sequence
Rakesh kumar jha
 
Matlab implementation of fast fourier transform
Matlab implementation of  fast fourier transformMatlab implementation of  fast fourier transform
Matlab implementation of fast fourier transform
Rakesh kumar jha
 
Verilog coding of demux 8 x1
Verilog coding of demux  8 x1Verilog coding of demux  8 x1
Verilog coding of demux 8 x1
Rakesh kumar jha
 
Verilog coding of mux 8 x1
Verilog coding of mux  8 x1Verilog coding of mux  8 x1
Verilog coding of mux 8 x1
Rakesh kumar jha
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
Rakesh kumar jha
 
Ad

Recently uploaded (20)

JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
Reflections on Morality, Philosophy, and History
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
Uses of drones in civil construction.pdf
Uses of drones in civil construction.pdfUses of drones in civil construction.pdf
Uses of drones in civil construction.pdf
surajsen1729
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
Uses of drones in civil construction.pdf
Uses of drones in civil construction.pdfUses of drones in civil construction.pdf
Uses of drones in civil construction.pdf
surajsen1729
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Ad

Verilog code for decoder

  • 1. Verilog code for 3*8 decoder module decoder(a,b,c, z); input a,b,c; output [7:0] z; wire abar, bbar,cbar ; assign abar =~ a; assign bbar =~ b; assign cbar =~ c; assign z[0] = abar & bbar & cbar ; assign z[1] = abar & bbar & c ; assign z[2] = abar & b & cbar ; assign z[3] = abar & b & c ; assign z[4] = a & bbar & cbar ; assign z[5] = a & bbar & c ; assign z[6] = a & b & cbar ; assign z[7] = a & b & c ; endmodule
  • 2. Verilog code for 3*8 decoder( alternate style of coding) module decoder(a,b,c, z); input a,b,c; output [7:0] z; wire abar, bbar,cbar ; not inv1 ( abar, a); not inv2 ( bbar, b); not inv3 ( cbar, c); and a0 ( z[0],abar,bbar,cbar); and a1 ( z[1],abar,bbar,c); and a2 ( z[2],abar,b,cbar); and a3 ( z[3],abar,b,c); and a4 ( z[4],a,bbar,cbar); and a5 ( z[5],a,bbar,c); and a6 ( z[6],a,b,cbar); and a7 ( z[7],a,b,c); endmodule