Logic Gates implementation using FreeSoc2 Cypress FPGA

Microprocessor, Microcontroller, Computers Laptops.


But have you ever imagined where from all these digital came from?

Yes! it’s the “Logic gates” that are used to form the complex CPUs that execute our complex mind in a fraction of a second. There are millions of transistors to say it’s a “0” or “1”. So these combinations of transistors make the Logic gates to perform some operations.

Some of the basic gates include “AND gate”, “OR gate”, NOT gate” and it goes on as XOR, NAND and so on.

The FreeSoC2 board it is an amazing product from sparkfun that has the PsoC5LP from Cypress Semiconductors that uses a ARM cortex M3 core.

Conceptually the fabric got some interesting features, like it is more or less similar to an FPGA or a CPLD where you can implement your own logic. FreeSoc2 is having extreme ability to create your own custom hardware blocks within the processor and you also have full control over the pin routing etc.

Another cool feature is the PsoC creator IDE that comes with a graphical programmable interface, so you don’t have t write even a single line of code to make your gates work, just a kind of graphical drag and drop will work better.

So here in this demonstration below we will use the PSoC Creator to make out some basic Gates

First we will try to make the simple NOT gate that has a single “INPUT” and a single “OUTPUT”

The symbol of the NOT gate ……      The truth Table of the NOT gate

notgate                            notgate_table

AND gate and its truth table.

andgate       andgate_table

Now we will see how to program it.

You can download the IDE from the following link


Open the PSoC creator once it is installed, once you connect your FreeSoC2 to your USB in the debugger port the device drivers that are required for it will be automatically installed.

Once you open the IDE you will find the below screen

Now goto File->New Project and then select PSoC5LP Design in the next selection menu.

Yes, now you are done with creating your workspace.

Now goto to the right of your IDE and in “Digital à logic” drag and drop what all gates you want to test.

In my IDE I have used the NOT and AND gate, Now configure the pins as input or output by brag and drop to the gates.

Configure the pin numbers by double clicking on the .cydwr file.

And click on the program button as it is circled red in the above screenshot.

And now it’s ready. Now connect the switch ond LEDs in the port you configured to see the LOGIC GATES working.

Posted in Dev Boards and tagged , , , .