Coder Social home page Coder Social logo

madhu82764 / verilog-starter-tutorials Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ashishrana160796/verilog-starter-tutorials

0.0 0.0 0.0 26 KB

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

License: Other

Verilog 95.56% Coq 4.44%

verilog-starter-tutorials's Introduction

Verilog Tutorials

This is a beginner friendly tutorial repository to learn verilog easily with all the basics that are required to get started for this language. Also, this repository is read only and is not currently being maintained by the author .

Installation For Linux

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

Introduction

Verilog is a hardware language which is a concurrent, case-sensitive and synthesizable 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 synthesis tools can convert design to any fabrication technology.

Now, verilog's basic building block is a 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 is complex and decreasing in popularity.

Data Types

Two primary data-types are as follows :

  • Nets : Connection between the components. Internal connection & is needed to be hidden from the 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 Impedance).

Integers, Arrays, Memories, Parameters, Strings are few other data types.

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 /* ... */ multiple comment lines.

  • $display vs $monitor : $dispay is used to display immediate value of variables. It gets executed in an 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.

Regular Codes

  • Data Flow Modelling and Logic Gate Modelling
  • Asynchronous and Synchronous D-FlipFlop
  • Four Bit Counter
  • Decoder 3x8
  • Encoder 4x2
  • DeMux 1x4
  • Mux 2x1
  • SR Flip Flop
  • JK Flip Flop
  • T Flip Flop
  • D Flip Flop

Code For Concepts

  • Blocking Statements and Non-Blocking Statements
  • Seven Segment Display
  • Mealy '000' Sequence Machine and Mealy '1001' Sequence Machine
  • Moore '000' Sequence Machine
  • Traffic Lights - Two Lights/4-Point Crossing

Case-Study

  • Biometric Authorization : Authorization happens only when hashed value is matched for particular input

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.

verilog-starter-tutorials's People

Contributors

ashishrana160796 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.