Coder Social home page Coder Social logo

hansinahuja / 32-bit-alu Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 8.56 MB

A 32-bit ALU using combinational logic written in Verilog.

Pascal 0.20% Verilog 16.88% Shell 5.58% Tcl 9.31% C 49.27% HTML 4.53% JavaScript 13.83% PureBasic 0.04% Batchfile 0.37%
alu combinational-logic verilog verilog-project

32-bit-alu's Introduction

******** README ********

NOTE:- We are only submitting the verilog .v source files i.e. the VIVADO Design sources.The complete vivado project is available at https://www.github.com/hansinahuja/32-Bit-ALU.git . It can be made public on demand.

CS203: 			Digital Logic Design
Instructor: 		Dr. Neeraj Goel
Project: 		32 Bit ALU
Contributors:		Hansin Ahuja (2018csb1094)
	       		Paras Goyal (2018csb1111)

*** Features ***
1) Fast adder:			control 0
2) Multiplier:			control 1
3) Subtractor:			control 2
4) Logical left shift:		control 3
5) Logical right shift:		control 4
6) Arithmetic right shift:	control 5
7) Bitwise AND:			control 6
8) Bitwise OR:			control 7
9) Bitwise NOT:			control 8
10) Bitwise XOR:		control 9
11) Comparison:			control 10

*** How to run ***
The module 'main.v' takes 3 inputs:
1) A		32 bit
2) B		32 bit
3) control	4 bit

and gives 6 outputs:
1) S		32 bit
2) carry	1 bit
3) overflow	1 bit
4) lessthan	1 bit
5) equalto	1 bit
6) zero		1 bit

*** Behaviour ***
1) S: stores result of the operation performed on A and B as indicated by the control input. The operation is only performed on input A if is a single input function, i.e. bitwise shift or bitwise NOT.

2) carry:
	if control = 0: 	stores carry generated by addition of A and B
	else if control = 2: 	stores carry generated by 2s complement subtraction of A and B, ie carry = 1 for a positive result and carry = 0 for a negative result
	else:			carry = 0

3) overflow:
	if control = 1:		overflow = 1 if multiplication of A and B yields a result which cannot be stored in 32 bits or if the result of multiplication is a negative number (33rd Bit is considered as sign bit here). Else, overflow = 0.
	else:			overflow = 0


4) lessthan:
	if control = 10:	lessthan = 1 if A < B. Else, lessthan = 0.
	else:			lessthan = 0

5) equalto:
	if control = 10:	lessthan = 1 if A = B. Else, lessthan = 0.
	else:			lessthan = 0

6) zero:
	= 1 if S = 0 and control != 10
	= 0 if S != 0 or control = 10
	 

32-bit-alu's People

Contributors

hansinahuja avatar parasgoyal12 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

parasgoyal12

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.