Home.Verilog.Digital Design.Digital Basics.Python.RF Basics.
Custom Search

Legal Disclaimer

Chip Designing for ASIC/ FPGA Design engineers and Students
Digital-logic Design...  Dream for many students… start learning front-end…

Legal Disclaimer

@TYH :- 4G LTE Long Term Evolution Tutorial, CloudComputing
Verilog Tutorial.
Get Noticed:- Submit your own content to be published on fullchipdesign.com

Send it to fullchip@gmail.com

Digital Basics Tutorial.

Verilog Case construct.

Verilog “case” statements are used to model states in Finite State Machine.

Its also used to generate conditional statements based on value of a register. Case statement implementation is shown below in two examples below.

Another implementation of “case” construct here.

Next Check the counter code and the test bench example.  


// Always block to generate synchronous packets in 1fs clock domain

// Implementing counters

always@(posedge clk_1fs or negedge rst_n)


    if (!rst_n) begin

        r_count <= 'b0;  end

    else begin

        r_count <= count + 1 ; end


Synchronous Counter Example:
Counters are extensively used in synchronous RTL. In current implementation, its used for keeping track of packets. Check the complete usage of the counter code in the test bench example.  
Home Verilog Initial stmts IF-ELSE Case stms Readmemh Function Testbench Binary to Gray Clock Crossing Half-adder Full-adder Tristate buffer Adder tb Counter_enable Blocking Operators Shift LSR Random Nos Sync RAM Verilog Tutorial
Free running Verilog counters code with asynchronous reset and synchronous reset
Interview Questions. Main, FPGA, Digital Fundamentals
        module casecode (
        // Define inputs/outputs
        input  in_a;
        input  in_b;
        input  in_ctrl;
        output out_c;
        // Use of case statement. 
                1 : out_c = in_b;
                default: out_c = in_a;

Verilog case construct above is a simple multiplexor to select one of two inputs and assign it to output c.  Verilog 2001 onwards we can use * operator to list all variables of senstivity list of always block. Also note the use of default statement in verilog case is to avoid inferring of latches. The default statement ensures a known logic value for output at all unknown states.

LTE - Long Term Evolution topics from here

3D draw and render new, 2D, 2D to 3D, ARC, 3D semi-cylindrical,  door,  Edgeing, drawer, colors  and render.

To handle ‘z’ and ‘x’ states, different variations of case statement  are used.

casez : Treats z as don't care.

casex : Treats x and z as don't care.

SystemVerilog case statement construct is similar to verilog.



5 Steps required to build a functional FPGA load