Verilog hdl - II

VERILOG HDL II MOORE MACHINE REVISITED A good way to specify Moore is to use separate procedural

blocks for Next State Combinational Logic For the state update Sequential Logic

Output Combinational Logic THE THREE STATES OF MOORE:

MOORE DUAL SEQUENCE OVERLAPPING: A Moore type sequence FSM that reads a binary sequence w

and sets z = 1if either a 110 or a 101 pattern with overlaps is detected. The state diagram for such a machine is as follows.

VERILOG FOR MOORE 1MODEL: VERILOG CODE FOR MOORE 2:

VERILOG CODE FOR MOORE 3: Cannot put z in the always block else it would have been

edge sensitive

Z is combinational and by putting it in always an extra flop would be required leading to extra clock cycle MEALY DESIGN OF THE SEQUENCE

I/O DECLARATION IS THE SAME AS MOORE 1-BIT FULL ADDER/SUBTRACTOR:

EQUATIONS FOR THE ABOVE CIRCUIT: (W = sub XOR y); 1s compliment of w

(S = X XOR W XOR Cin); Computing the sum using Binary Arithmetic (Cout = X * W + X * Cin + W * Cin); Choosing W chooses if

its addition or subtraction 1 BIT ADDER/SUBTRACTOR : STRUCTURAL DESCRIPTION:

4-BIT ADDER SUBTRACTOR FROM 1-BIT MODULE, 4 INSTANTIATIONS VECTORED SIGNALS:

Specifying all bits individually is cumbersome. Use vectored signals for a cleaner code.

input [3:0] x; (Makes x a 4 bit quantity) x[3] MSB, x[2], x[1], x[0] LSB Input [15:0] x; (Represents vector x with16 bit quantity x [15:8]; [Represents an 8 bit vector with the 8 most MSBs],

LSB[7:0] x [7:6]; Represents a 2 bit vector consisting of x[7], x[6]

4-BIT VECTORED ADDER/SUBTRACTOR BEHAVIORAL 1 BIT MODULE TO BE INSTANTIATED:

GENERALIZING THE SIZE OF A LARGE MODULE The ripple carry adders we created have a fixed length. If a 32-bit or a 64- bit adder was needed, we would need as many instantiations of FullAddSub.

Desirable from designers perspective to define an AddSub module that n number of bits can be set to any value.

In Verilog such a construct exists, can specify n as : parameter n = 15 and then write input [n-1:0] x. This case is for 16 bit vector.

GENERAL DESCRIPTION OF PARAMETERIZED I BIT ADDER Wk = sub XOR Yk, sub is 1 for subtraction and zero for addition

Sk = Xk XOR Wk XOR Ck Ck = Xk * Wk + Xk * Ck + Wk * Ck For k = 0, 1, 2---k-1

THE FOR LOOP: In Verilog the repetitive structure for the of the ripple carry adder/subtractor can be specified using for procedural statement, (for k=1; k

The syntax is same as C/C++ except that increments and decrements have to specified explicitly as k = k+1 and k = k-1, since ++, -- operators doesnt exist in Verilog.

For is a procedural statement and needs to be put inside a procedural block such as always block. Outputs of procedural blocks goes to registers.

Recently Viewed Presentations

  • VALUES TO BUILD ON.. O C  M M

    VALUES TO BUILD ON.. O C M M

    7. HUMILITY Philippians 2:3 "Do nothing out of selfish ambition or vain conceit, but in humility consider others better than yourselves." HUMILITY is the voluntary lowering of yourself or the willingness to give up something that should rightfully be yours....
  • Maximizing Internet Connectivity for Education  David Olson, Network

    Maximizing Internet Connectivity for Education David Olson, Network

    Moodle, Content Repository, BigBlueButton/Vidyo. Net-centric services provides the 'value-add' to the network - buy access to the network and get access to all these other things, especially things that are included (db access, peering, etc.) Now I'd like to introduce...
  • Get up Rick! Vocabulary and Spelling Book 1 Story 4

    Get up Rick! Vocabulary and Spelling Book 1 Story 4

    pick. To select from a group. I will pick an apple to eat. pack. A collection of items to be gathered and placed inside a bag or sack. I will pack my book bag. tack. A short, light nail with...
  • Title of Program: Medicine Grand Rounds Title of

    Title of Program: Medicine Grand Rounds Title of

    Ting "Christina" He. Weill Cornell Medicine. Jonathan Hingre. State University of New York Upstate Medical University. Arjun . Janardhan. Robert Larner, M.D., College of Medicine at the University of Vermont. Aurasch Moaven. University of Maryland School of Medicine. Alison Kim....
  • Liberty in Christ Applications from Galatians Free to

    Liberty in Christ Applications from Galatians Free to

    2 Corinthians 5:10 (NIV) For we must all appear before the judgment seat of Christ, so that each of us may receive what is due us for the things done while in the body, whether good or bad. 2 Corinthians...
  • The Hellenistic Age

    The Hellenistic Age

    On the way back to Greece, Alexander came down with a fever and died at the age of 33. PALANX SARISSA SPEAR - (13-21 Feet Long) Alexander's Empire The Hellenistic Age Although Alexander's empire soon crumbled after his death, his...
  • Poppies - Resources for Miss Archer's GCSE classes

    Poppies - Resources for Miss Archer's GCSE classes

    Poppies. By Jane Weir. Learning Objective To understand the context and subject matter of the poem. A series of numbers relating to recent conflicts will appear on the following slides. Your task, as a group, is to suggest what you...
  • Chap 18 Bell -Ringers - Mayfield City Schools

    Chap 18 Bell -Ringers - Mayfield City Schools

    Chap 4 Bell -Ringers. The Structure of the Atom. ... It was like trying to describe a picture, such as the one on the next slide, with only small portions visible. Bellringer, continued. 1. ... William Crookes invents a tube...