Project Report (Scientific Calculator) Course: Digital Logic Design School Of Electrical Engineering And Computer Sciences National University Of Sciences And Technology - Pakistan School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 1 Project Report (Scientific Calculator) Course: Digital Logic Design PROJECT REPORT DIGITAL LOGIC DESIGN School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 2 Project Report (Scientific Calculator) Course: Digital Logic Design Scientific Calculator Sin, Cos & Tan Functions Using Digital Logic!! ) School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 3 Project Report (Scientific Calculator) Course: Digital Logic Design Group Members: 1. 2. Waqas Maqsud (2008-nust-bee-432) M. qumar zaman (2008-nust-bee-375) Submitted To: Mr. Abdullah mansoor (Department of Electrical Engineering) Date Of Submission: June 03, 2010 School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 4 Project Report (Scientific Calculator) Course: Digital Logic Design

Acknowledgments: Our heartiest acknowledgments are for Sir Abdullah Mansoor whose motivation and believe in our potential gave us courage to design our own project. School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 5 Project Report (Scientific Calculator) Course: Digital Logic Design This Project is dedicated to our parents whose prayers have made us successful in our life. Between the idea & the achievement there is one word HOW & it’s HOW which makes the difference School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN)

Introduction: Our Project of Scientific Calculator is implementation of basic Trigonometric Functions using the knowledge of Truth Tables, K-maps, Boolean Algebra and Various Integrated Circuits of Demultiplexers, Decoders, MUX etc. We have The functions implemented in the calculator can be switched using two switch buttons and input to the calculator can be given in the binary equivalent of decimal in four bits that is input of up to 15 can be given to the calculator. The functions are designed in such a manner that these trigonometric functions will cover ? - radians (1800).

The input will be considered as multiple of 150 or ? / 12 radians. Output display on 7- segment. There are 5 seven segment displays out of which the left most will tell the sign of function value. School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 8 Project Report (Scientific Calculator) Course: Digital Logic Design Designing: Functionality: Input to the calculator is given in the multiples of 150 that is if 0011 is the input given by user its binary equivalent is 3 so output will be value of (sin/cos/tan) (3 times 150) that is at 450. Truth Tables: 1. Truth Table Of Sin

Now look at the minimized expression in order to implement this logic we need lot of AND, OR and NOT gates. It means impossible circuit and extensive hardware implementation. So HOW to avoid it ??? Big Question Mark ? Solution: But where there is a will there is a way. So we solved this problem by using 416 Demultiplexer and using the minterms of Demultiplexer we were able to implement all the three trigonometric functions easily by just using OR gate IC’s. School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN)

Project Report (Scientific Calculator) Course: Digital Logic Design Selection Switches: Output of the selected function is displayed up to 3 decimal places, so digit before decimal point and three digits after decimal point are displayed at the output. There is another seven segment which displays negative sign in case of negative value and “E” will be displayed on all the seven segments in case of tan 900. The outputs displayed on the seven segment are connected to multiplexers which determine which output to be displayed on the seven segment.

The selection lines of these multiplexers are connected to each other and finally to the selection switches. Every selection switch allows respective minterms to pass through multiplexer to the BCD to seven segment decoder. Selection Input 00 01 10 Output Function Sin Cos Tan School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 15 Project Report (Scientific Calculator) Course: Digital Logic Design Block Diagram: Output Display Input Display Input Switches BCD to 7 Segment Decoder 4 To 16 Line Decoder Sine Demultiplexer BCD to 7 segment Decoder

Cosine Circuit of Input Display Tangent Controlling Switches School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) 16 ….. 4 lines to 1 line Multiplexers Page 16 Project Report (Scientific Calculator) Course: Digital Logic Design Calculator Manual: Step: 01 “Select The Function” Select the desired Function using selection switches. 1) Sine 2) Cosine 3) Tangent 00 01 10 Step: 02 “Enter The Binary Input” Once you have selected the function now give the input to the calculator. You can give input as decimal equivalents from 0 to 12 as the multiples of 150.

For example if you give input “0001” output will display the value of selected function in step 1 at “1 times 150 = 150”. Step: 03 “Output Module” The output is shown on 5 seven segment displays. One seven segment is specified for the negative sign (in case if) and 1 seven segment for the digit before decimal point and rest of the 3 seven segments for the three decimal points. “E” will be displayed on all the seven segments in case of tan 900. School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 17 Project Report (Scientific Calculator) Course: Digital Logic Design Hardware Employed:Following hardware is used to give this idea a physical shape: 1) 6 Input Switches a) 4 Input switches b) 2 Selection switches 2) 7 breadboards 3) 4 to 16 line Decoder 4) 7 seven segment displays a) 2 for Input Display b) 5 for output Display 5) About 40 + OR Gates a) 15 ~ 16 OR Gate IC’s with Fan in of “4” (7 ~ 8) b) 18 ~ 20 OR Gate IC’s with Fan in of “2” (3 ~ 5) 6) About 8 AND Gates a) 5 AND gates with Fan in of 2 (2 ICs) b) 3 AND gates with Fan in of 3 (1 IC) 7) 7 BCD to seven segment decoders 8) Connecting Wires 9) 14 ~ 16 multipliers (4 line to 1 line) More Reduced Circuit !!! We tried to minimize the hardware as much as possible.

This hardware can also be minimized if we use a little technique. Simply if we use an adder IC and set one input of adder “0110” which is binary code of 6 and (multiple of 15 that is 90) now as we know sine is also a cosine wave delayed by an angle of 90 degree so by giving the output of this adder to sine circuit we can implement Cosine function with only one IC instead of 7 to 8 more ICs. School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 18 Project Report (Scientific Calculator) Course: Digital Logic Design School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN)

Page 19 Project Report (Scientific Calculator) Course: Digital Logic Design School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 20 Project Report (Scientific Calculator) Course: Digital Logic Design School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN) Page 21 Project Report (Scientific Calculator) Course: Digital Logic Design Special Thanks: We would like to thank lab attendants of Embedded System lab and Basic Electronics lab who really helped us when we needed them. School Of Electrical Engineering And Computer Sciences – NUST (PAKISTAN)