SlideShare a Scribd company logo
2
Most read
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

More Related Content

What's hot (20)

PDF
Chapter 5 introduction to VHDL
SSE_AndyLi
 
PPTX
Powerplanning
VLSI SYSTEM Design
 
PPTX
Design for testability and automatic test pattern generation
Dilip Mathuria
 
PDF
Fsm sequence detector
lpvasam
 
PDF
Delays in verilog
JITU MISTRY
 
PDF
Pic 16f877 a
bmsjh
 
PPTX
Study of inter and intra chip variations
Rajesh M
 
PDF
Verilog lab manual (ECAD and VLSI Lab)
Dr. Swaminathan Kathirvel
 
PDF
13 static timing_analysis_4_set_up_and_hold_time_violation_remedy
Usha Mehta
 
PPTX
Contamination delay
Nima Afraz
 
PPTX
ASIC DESIGN FLOW
Purvi Medawala
 
DOCX
Design of Elevator Controller using Verilog HDL
Vishesh Thakur
 
PPT
verilog
Shrikant Vaishnav
 
PPT
system verilog
Vinchipsytm Vlsitraining
 
DOCX
4 bit uni shift reg
E ER Yash nagaria
 
PPTX
Interfacing with peripherals: analog to digital converters and digital to ana...
NimeshSingh27
 
PPTX
DIFFERENTIAL AMPLIFIER using MOSFET
Praveen Kumar
 
PDF
Zynq architecture
Nguyen Le Hung Nguyen
 
PPTX
Cyclic code non systematic
Nihal Gupta
 
Chapter 5 introduction to VHDL
SSE_AndyLi
 
Powerplanning
VLSI SYSTEM Design
 
Design for testability and automatic test pattern generation
Dilip Mathuria
 
Fsm sequence detector
lpvasam
 
Delays in verilog
JITU MISTRY
 
Pic 16f877 a
bmsjh
 
Study of inter and intra chip variations
Rajesh M
 
Verilog lab manual (ECAD and VLSI Lab)
Dr. Swaminathan Kathirvel
 
13 static timing_analysis_4_set_up_and_hold_time_violation_remedy
Usha Mehta
 
Contamination delay
Nima Afraz
 
ASIC DESIGN FLOW
Purvi Medawala
 
Design of Elevator Controller using Verilog HDL
Vishesh Thakur
 
system verilog
Vinchipsytm Vlsitraining
 
4 bit uni shift reg
E ER Yash nagaria
 
Interfacing with peripherals: analog to digital converters and digital to ana...
NimeshSingh27
 
DIFFERENTIAL AMPLIFIER using MOSFET
Praveen Kumar
 
Zynq architecture
Nguyen Le Hung Nguyen
 
Cyclic code non systematic
Nihal Gupta
 

More from Rakesh kumar jha (10)

PDF
matlab code of shifting and folding of two sequences
Rakesh kumar jha
 
PDF
MATLAB CODE OF Shifting sequence
Rakesh kumar jha
 
PDF
Matlab implementation of fast fourier transform
Rakesh kumar jha
 
PDF
Verilog coding of mux 8 x1
Rakesh kumar jha
 
PDF
VERILOG CODE FOR Adder
Rakesh kumar jha
 
PDF
verilog code for logic gates
Rakesh kumar jha
 
PDF
Reversible code converter
Rakesh kumar jha
 
PPTX
Pin diode
Rakesh kumar jha
 
PPTX
Schottky diode
Rakesh kumar jha
 
matlab code of shifting and folding of two sequences
Rakesh kumar jha
 
MATLAB CODE OF Shifting sequence
Rakesh kumar jha
 
Matlab implementation of fast fourier transform
Rakesh kumar jha
 
Verilog coding of mux 8 x1
Rakesh kumar jha
 
VERILOG CODE FOR Adder
Rakesh kumar jha
 
verilog code for logic gates
Rakesh kumar jha
 
Reversible code converter
Rakesh kumar jha
 
Pin diode
Rakesh kumar jha
 
Schottky diode
Rakesh kumar jha
 
Ad

Recently uploaded (20)

PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PDF
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PDF
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PPTX
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PPTX
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
PPTX
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
PPTX
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
PDF
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
Design Thinking basics for Engineers.pdf
CMR University
 
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
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