FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

esch3r/VerilogTutorial: Tutorial series on verilog with code examples. Contains basic verilog code implementations and concepts. · GitHub

 
 

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Verilog Tutorials

This is a tutorial repository to learn verilog easily with all the basics that are required to get started for this language.


Installation For Linux

  • sudo apt-get update
  • sudo apt-get install verilog
  • sudo apt-get install gtkwave

Introduction

Verilog is a hardware language. Examples of such languages are VHDL( VHSIC(Very High Speed Integrated Circuit) HDL). It is vendor independent for example, Xilinx, Verywell etc.Full form verilog is Verify Logic. It is used for Digital ICs not for Analog ICs. It uses gate level design abstraction. It was made at Gateway Design Automation and now is IEEE 1364-2001 standard. HDL came to help with the verification of design of complex circuits that are in place. Also, logic systhesis tools can convert design to any fabrication technology. Verilog is concurrent, case-sensitive and synthesizable language.

Now, verilog's basic building block is module that provides information about input and output ports but hides internal implementation.

Levels of abstraction

  • Behavioral Level( Design of Algorithm ) : Algorithmic and performance oriented programs are written with it.
  • Dataflow Level( Design of Equation ) : "assign" keyword is used for dataflow modelling. ex : assign c = a+b;
  • Gate Level( Interconnection with Logic Gates ) : Circuits will be defined by logic gates. ex : and(output, input) etc.
  • Switch Level( Implementation in terms of switches ) : Transistors either MOS or switches which conduct or are open. This style in complex and decreasing in popularity.

Data Types

Two primary data-types are as follow :

  • Nets : Connection between the components. Internal connection & is needed to be hidden from user. Like, wire a;
  • Registers : Store the data in variable. Like, reg a;

Other data-types are :

  • Vectors : nets and registers can be declared as vectors with different widths. Like, wire[2:0] a; reg[7:0] b;
  • Values : 0(Logical zero/false), 1(Logical one/true), X(Unknown Logic Value), Z(High Impedence).

Integers, Arrays, Memories, Parameters, Strings are few other datatypes.


Concepts To Get Started

  • Module Instantiation : Process of connecting one module to another.
    Its subparts are Positional Mapping and Nomenclature Based Mapping.
ex 1 : module pos_map(q,clk,rst)
       output[1:0] q;
       input clk, rst;
       tflipflop lab0(q[0], clk, rst);
       tflipflop lab1(q[1], clk, rst);
       end
       
ex 2 : module nom_map(q,clk,rst)
       output[1:0] q;
       input clk, rst;
       tflipflop lab0(.q(q[0]), .clk(clk), .rst(rst));
       tflipflop lab1(.q(q[0]), .clk(clk), .rst(rst));
       end
  • Comments : // for single line comment and /* ... */ multple comment lines.

  • $display vs $monitor : $dispay is used to display immediate value of variables. It gets executed in active region. $monitor gets executed whenever the value of the given variable changes in it. It gets executed in the postponed region. Monitor is required only once to be written.

Note

More relevant points to be added.


Regular Codes

  • and

Code For Concepts

  • and
  • and

Case-Study


DIY Codes

  • Half Subtractor, Full Subtractor, Half Adder, Full Adder : Using DataFlow, LogicGate Modelling, case statements.
  • Master-Slave JK Flip-Flop : Truth table for master and slave latch both.

About

Tutorial series on verilog with code examples. Contains basic verilog code implementations and concepts.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL