Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help making a simple "calculator"

Status
Not open for further replies.

Tabur

Newbie level 1
Joined
May 30, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Chile
Activity points
1,294
Hi there!

I'm trying to build a "simple calculator". It is supposed to be able to add or subtract any two 7bit numbers (be it positive or negative numbers).

until now, I have most of it already done:

First of all, both 7bit number (A and B from now on) have another bit that tells the system whether its a positive (0) or negative (1) number. If its negative, then It makes the compliment of 2. If not, It just goes into the Full Adder. Same for the B number.

Also, theres a switch (X) that tells the system if it should add (0) or subtract (1) B to A. For instance, if the switch is 1 and both A[8] and B[8] are 0, its the same as A - B, or, A + Bcomp2.

All of that is already made, now, heres my 2 problems:

1.- I dont know how to catch Overflow ( I need a LED display to light when theres overflow)

2.- I dont know when to compliment the Result (S) of the addition when its negative. I know I can just use an 8bit number comparator and if the first is smaller than the second and I'm subtracting, then compliment again, but I'm SURE theres a simpler way (I need to fit this into a protoboard and to make this as simple as possible).


Could you help me getting this right???

I'll upload the schematics I have until now


Thanks!
 

Tabur said:
I dont know how to catch Overflow ( I need a LED display to light when theres overflow)


your carry out of final result can be used as overflow detector....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top