# Introduction icrocontrollers are capable of executing all digital logic design operations. In another paper we have implemented 28 digital logic design operation by one microcontroller [1]. But still if a 16bit operation is needed we have to cascade two 8bit microcontrollers. Instead of cascading two microcontrollers, it is possible to do operations up to 24bits with this IC. This IC can perform AND, OR, NOR, NAND, XOR, XNOR, Universal Shift Register, Counter operations etc. The Controller used in this project is Atmega1280. It has 86 GPIO. In this project there are 6sets of 8bit input, 25bit output, 6bit main operation selection option and additional 5bit to select sub operations. When Rest of the pins of portG represent sub operations and to select main operation portH is used. Enable_bar means to enable the IC we need to make portH6_bit low. PortH7 represent syncronous clock input. When 16bit operations are selected PortA are lower eight bits & PortB are higher eight bits. In the same way for input2 & input3 portF, Portk are lower eight bits and PortJ, PortL are higher eight bits accordingly. For 24bit operation in input1 portA are lower eight bits, portB are higher eight bits, portF are most significant eight bits. For second input PortJ are lowest significant bits, portK are higher eight bits, portL are highest eight bits. At output, portC are most significant 8bits, portD are higher 8bits, PortE are more higher 8bits & portG6_bit is the MSB. # Circuit Description Atmega1280 is used as microcontroller in this project. Operating voltage of atmega1280 is +5v. Here VCC is +5v. Atmega1280 has 86 GPIO, 11 GPIO ports. They are PORTA, PORTB, PORTC, PORTD, PORTE, PORTF, PORTG, PORTH, PORTJ, PORTK and PORTL. Among these ports PORTA, PORTB, PORTF, PORTJ, PORTK, PORTL, PORTH and PORTG are all input. PORTC, PORTD, PORTE & PORTG5_bit are all output. To give input toggle switches are used and to see the output LEDs are used. There are two more inputs one is Enable and another is for clock. Microcontroller has its own clock connected to Xtal1 & Xtal2 pin. Value of oscillator is 16 MHz. A reset circuit is connected with RESET_bar pin to reset the microcontroller. This microcontroller can execute 28 operations and lots of sub operations. To select main operation PORTH0 to PORTH5 total 6 pin is used and to select sub operation PORTG0 to PORTG4 is used. To Enable and disable the IC, Enable_bar is used at PORTH6_bit. External clock is used at PORTH7_bit. This IC can operate in both asynchronous and synchronous mode. When there is no external clock it will operate in asynchronous mode and while clock is used it will operate based on the clock frequency. If Enable_bar pin is high at that time microcontroller will not take any clock input or will not work in asynchronous mode also. # a) Main Technology Used Main technology of this IC is the programming method. To perform any operation with this IC, at first the main operation mode and sub operation mode is selected. For example if we want to do an addition operation the mode 00 is selected. PortH0 to PortH5 has to be 0. Then we have to select sub operation like we want to do an 8bit, 16 bit or 24bit addition. If we want an 8bit addition we have to set the value of PortG0_bit & PORTG1_bit equal to 0. As this is an 8bit operation we have the option to choose with how many variable we would like to do the operation. We can choose an addition operation from two variables to six variables maximum. Let's choose 2 variables. Then Value of PortG2_bit is 0, PortG3_bit is 1 & PortG3_bit is 0. Here PortG2_bit is LSB and PortG3_bit is MSB. Now it is ready to perform two 8 bit additions. Any value of PortA will be added with any value of PortB and output will be shown by LEDs in binary format. PortC0_bit is the LSB bit of output and PortG5_bit is the MSB bit. For an 8bit operation we need to select number of inputs but for 16bit or 24bit operation this IC will start working instantly when main operation and sub 24 bit which have sub operations also. For example if we want to execute a 24bit Barrel shifter, we have to set the main operation first. H5=0, H4=1, H3=1, H2=0, H1=1, H0=0. Then we have to select sub operation that, shift it right or shift it left. So, the sub operation G0=0, G1=0 is set for shifting right arithmetic. Then we have to select the amount of shifting through Pin G2 to G4. The table below gives us the operation chart and bit values to set them In the above table sub operation of addition is shown and how to select the operation bit values are also shown. In this way all the other operations are performed. If we wants to do subtraction IN1 has to be the largest number than second largest should be IN2, so that we don't get any wrong answer for subtraction. This order is maintained for division also. For two inputs, the equation is IN1/ IN2. Segment Decoder takes input as binary value and gives output for common cathode without dot, common cathode with dot, common anode without dot and common anode with dot. For example if L3=0, L2=1, L1=0, L0=0 then segment with show 4 as output. Ones counter, binary counter, Mux, Demux all these operations are also divided according to the above table. But Universal shifter and barrel shifter have other sub functions. These functions are shown below: G4 G3 G2 IN1 IN2 IN3 IN4 IN5 IN6 Equation Operation 0 1 0 PortA PortB X X X X IN1+IN2 ADD 0 1 1 PortA PortB PortF X X X IN1+IN2+IN3 1 0 0 PortA PortB PortF PortJ X X IN1+IN2+IN3+IN4 1 0 1 PortA PortB PortF PortJ Portk X IN1+IN2+IN3+IN4+IN5 1 1 0 PortA PortB PortF PortJ Portk PortL IN1+IN2+IN3+IN4+IN5+IN6L3 L2 L1 L0 OPERATIONS SUB X 0 0 0 Hold SIPO SISO PISO PIPO X 0 0 1 Load X 0 1 0 Load & Shift Right X 0 1 1 Load & Shift Left X 1 0 0 Shift Circular Right X 1 0 1 Shift Circular Left X 1 1 0 Shift Arith Right X 1 1 1 Shift Arith Left 0 0 0 0 Shift 0 Barrel Shifter 0 0 0 1 Shift 1 0 0 1 0 Shift 2 0 0 1 1 Shift 3 0 1 0 0 Shift 4 0 1 0 1 Shift 5 0 1 1 0 Shift 6 0 1 1 1 Shift 7 ? ? ? ? ???. 1 1 1 1 Shift 15 Atmega1280 contains 135 powerful instructions like addition, subtraction, shifting etc and most single clock cycle execution.32x8 general purpose working resistors, two 8bit timer & four 16bit timer, interrupt and wakeup on pin change. It comes in 100 lead TQFP, 100 Ball CBGA wich can be breakout easily and small in size. This microcontroller has the most number of GPIO and all 86 GPIO pins can be used as input or output. Brown out feature of this Ic makes it more stable output and long lasting. ![user selects 16 bit operation mode, this IC combines Input1 & Input2 as 1st input of 16bit. Combination of Input3 & Input4 becomes 2nd input of 16bit. Input5 & Input6 are combined for 3rd input of 16bit. When user wants to do operation of 24 bit that time Input1, Input2 & Input3 combines & form 1st 24bit input. The rest Input4, Input5 & Input6 act as 2nd input of 24bit. And all the operations output is given through 25bit. Here 25th bit output is the carry bit for 24bit operations.](image-2.png "") 1![Figure 1 : Basic Project outline](image-3.png "Figure 1 :") 2![Figure 2 : Main Circuit Diagram](image-4.png "Figure 2 :") 3![Figure 3 : Atmega1280 Microcontroller[8]Our program consumes only 37kbytes of Flash memory. Still 91kbytes of Flash memory is available to design other operations.As the outputs are shown in simulation no resistors has been used. In practical implementation with each LED 220ohm resistance is being used. Each input Pin has been pulled down through 10k resistor.](image-5.png "Figure 3 :") 4![Figure 4 : 24bit Addition Operation[10]](image-6.png "Figure 4 :") 5![Figure 5 : 16bit 2input Subtraction Operation](image-7.png "Figure 5 :?") 11710001DemuxSegment Decoder1810010CommonCathodeSegment Decoder1910011CC Dot2010100Segment Decoder Common AnodeMain Operation Chart2110101Seg Dec CA Dot2210110Priority EncoderH4 H3 H2 H1 H0Operation2310111Priority Decoder0000000Addition2411000Parity Checker0100001Subtraction2511001Comparator0200010Multiplication2611010Barrel Shifter0300011Division2711011Ring Counter04 050 00 01 10 00 1AND OR2811100John. Ring Counter06 070 00 01 11 10 1NOT NORTable 2 : Sub operation chart08 09 100 0 01 1 10 0 00 0 10 1 0NAND XOR XNORG1 G0 0 0 0 1Sub Operation 8 bit 16 bitMain Operation Addition, Subtraction, Multiplication, Division,1101011Buffer1024 bitAll operations1201100Universal Shift RegisterTable 3 : Sub operation chart13 140 01 11 10 11 0Ones Counter Binary CounterG1 G0 Sub Operation 0 0 7 SegmentMain Operation Segment Display1501111Inverted Counter0114 Segment1610000Mux1016 Segment 48 bit level operations 5: 16 bit level operations 6: 24 bit level operations 7 8b) Device UsedBrain of this project is Atmega1280 micro-controller. It is an 8 bit Micro controller with RISCarchitecture. Its speed is up to 16 MIPS throughout at16MHz. It has 128K bytes of flash and 4KbytesEEPROM. Operating voltage 2.7v -5.5v, in active mode itconsumes only 1.1mA & in sleep mode it consumesless than 1uA current. It has 86 GPIO, 16 PWMchannels, SPI, 4 UART, I2C and other features whichmade it a perfect choice of designing a versatile digitaldesign IC. © 2013 Global Journals Inc. (US) * References Références Referencias © 2013 Global Journals Inc. (US) * Md Md. NasimuzzamanKhaled Hossain Chowdhury International Journal of Emerging Technology and Advanced Engineering 3 6 June 2013 * SDLDS-System for Digital Logic Design & Simulation ZStanisavljevic VPavlovic BNikolic JDjordjevic Education, IEEE Transactions on May 2013 56 * A Rapid Prototyping Environment for teaching Digital Logic Design AZemva ATrost BZajc IEEE Transactions 4 41 Nov 1998 * Digital design principles and practices by John F. Wakerly * Integrating Reconfigurable Logic in the First Digital Logic Course GuillermoAVera JorgeParra CraigKief MariosPattichis HowardPollard 9th International Conference on Engineering Education july 23-28 2006 * Remote Control of Industrial Machines Using Mobile Phone PoulastyaMukherjee January 2013 3 for project outline diagram * Atmega1280 datasheet by Atmel * for simulator and demo videos of simulation this IC can become handy