Git Product home page Git Product logo

verilog's Introduction

Description

Repository for Verilog building blocks with a high chance of reuse across different hardware projects (e.g. debouncers, display drivers).

Most of these modules are well tested and shouldn't have issues. However, I'm generally allowing myself to upload things which may have issues.

Modules

  • button_debounce.v -- Timing-based button debouncing circuit.

  • pipeline_registers.v -- A parameterized number of pipeline registers of some depth and width. This is primarily useful as a building block for other modules.

  • pipeline_registers_set.v -- Pipeline registers (as above), but with the ability to set the value of the registers.

  • ram_infer.v -- Xilinx standard module that will infer RAM during FPGA synthesis.

  • reset.v -- Implements a "good" reset with asynchronous assertion and synchronous de-assertion.

  • sign_extender.v -- Explicit sign extender (this should be unnecessary in Verilog...)

  • sqrt_pipelined.v -- A pipelined implementation of a fixed point square root. Deprecated due to complexity and incorrect rounding.

  • sqrt_generic.v -- A refactor of sqrt_pipelined.v into a cleaner syntax. This uses implicit truncation rounding and will show a resulting bias towards negative infinity.

  • uart_rx.v -- UART receiver.

  • uart_tx.v -- UART transmitter.

  • div_pipelined.v -- Pipelined division module (largely untested)

Submodules

In an attempt at modularity, I'm now including a submodules directory which is intended to contain other repositories (of mine most likely, but not restricted as such) that are useful. These can be pulled in with:

git submodule init
git submodule update

And recursively updated with:

git submodule foreach git pull origin master
  • hdl-tools -- Basically, a dumping ground of scripts I've written that make working with HDLs easier. For example, addWavesRecursive.tcl will populate a GTKWave configuration with the module hierarchy found in a VCD file.

verilog's People

Contributors

seldridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

verilog's Issues

Help to find minimum value from input

Hi, I'm new in verilog. I have problem in finding the minimum value for the input data. If anyone knows, please help this newbie.

Below is my code:
module assignments(in, clk, rst, out, max_value);
input clk;
input rst;
input [3:0] in;

output out;
reg [3:0]out;
reg odd, even;
reg[3:0] data1;
reg[2:0] cnte =0;
reg[2:0] cnto =0;
reg [2:0]maj; //majority

output reg [3:0] max_value;

reg [3:0] min_value;
reg [3:0] min_temp;

initial
begin
max_value = 0;
min_value=0;
end

always @ (posedge clk)

if (rst==0 )
begin
data1 <= in;

end

//max value
always @ (data1)
begin
if (rst == 0)
begin
if (data1 > max_value)
begin
max_value <= data1;
end
end
end

//min value //cant figure how to find the min value
always @ (data1)
begin
if (rst == 0)
begin
if (data1 > min_value)
begin
min_temp <= data1;

end
end
end

always @(data1)
odd = data1; // if data1 is odd out is 1, an out is 0 when data1 is even

always @(data1)
even= ~data1; // if data1 is odd out is 1, an out is 0 when data1 is even

//count how many even
always @(data1)
if (even == 0)
cnte <=cnte;
else cnte <= cnte+1;

//count how many odds
always @(data1)
if (odd == 0)
cnto <=cnto;
else cnto <= cnto+1;

//setup majority value is odd or evne
always @(cnto or cnte)
if (cnto >= cnte)
maj<=cnto;
else maj<=cnte;

always @ (maj)
if (maj <=cnte)
out <= max_value;
else
out <= 2;

endmodule

is debounce code really working?

Just did a simulation on debounce code(I'm a verilog newbie) and found signal 'debounce' wasn't de-bouncing the button input.

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.