Git Product home page Git Product logo

32bit-alu's Introduction

32bit-ALU

verilog语言,32位ALU加法器,支持加法并行方式和串行方式,6种运算(算术运算和逻辑运算),能够输出结果和4个标志位

实验内容

基于全加器,设计一个32位ALU,至少支持加法并行方式和串行方式,至少6种运算(算术运算和逻辑运算),能够输出结果和至少4个标志位。完成仿真验证和串并行进位链时间比较。

实验约束

实验设计加法相关采用结构化的描述方式,从全加器开始搭建或者按照逻辑运算,从基本门开始搭建,不直接使用Verilog HDL语言中的加法符号。其他ALU支持的运算自行确定设计方式。

功能描述

这里我设计了一个具有8种运算功能的32位ALU,实现6种逻辑运算和3种算术运算,并能够产生运算结果和其表示,ALU通过4根控制线ALU_OP[3:0]来选择其8种功能。

逻辑运算

image

算术运算

image

标志位

image

‘task’方法

在实验过程中,我发现在 always 语句下的条件分支结构不允许调用module 实例,所以为了尽可能提高 ALU 的处理速度,我对较为复杂的实例用任务进行改写,即主要应用了“task”方法。这里也简单叙述一下其特点:

任务(task)可以用来描述共同的代码段,并在模块内任意位置被调用,让代码更加的直观易读。任务可以调用函数和任务,可以作为一条单独的语句出现语句块中。需要强调的是,任务在执行的时候是按语句顺序执行的,所以需要在编写相关功能时考虑到。

实验结果

逻辑运算

image

并行运算

image

串行运算

image

32bit-alu's People

Contributors

robin-wzq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

flycloud2010

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.