Null Convention Logic Gates

See this post for information about NCL signals.

Symbol

It may or may not surprise you to know that NCL has it’s own set of gates for building circuits. They are called threshold gates and are drawn as

cropped-global-diagrams.png

with the ‘threshold number’ in the middle. The inputs come in on the left (round) part, and the output comes out the point on the right.

Operation

For all threshold gates:

  • If all inputs are 0, the output is 0
  • If the number of inputs that are set is >= the threshold number, the output is 1
  • Otherwise, it holds its value.

threshold gates can have input weights, meaning that an input can count towards the threshold count more than once.

Notation

A threshold gate is denoted as THmn where m is the threshold value (the number of inputs needed to transition to a 1) and n is the total number of inputs. If weights are needed, then THmnW## is used, where the #’s are replaced with the weights (order is irrelevant). A TH23W2 gate sets when the first input is set (as it is counted twice), or when both of the other 2 are set. The boolean logic function is

TH23W2 Set: A+BC

Note that when just B or C are set, the gate keeps its value, so if it was a 1, then it will stay a 1, and if it was a 0 it will stay a 0. The logic function for clearing the gates is essentially the same for all:

THm1 Clear: A'
THm2 Clear: A'B'
THm3 Clear: A'B'C'
THm4 Clear: A'B'C'D

Summary

Threshold gates are used in NCL because they are less volatile than standard gates. Once they have an output, they hold on to int until their inputs are completely cleared (circuit reset). This means that a NCL component’s output will not flip more than once in an operation. This property of threshold gates means that if the outputs are set, the component has completed, and if they are reset, it has cleared. You always know when it is ready to move on.

Null Convention Logic Signals

If you don’t yet know what asynchronous logic is, I recommend reading this post (or using Google).

For the time being, I will be focusing my efforts on Null Convention Logic (NCL). NCL is technically a separate logic system from boolean logic. For now, I’ll stick to considering it in the context of a boolean system. What that means is that all signals in the design will still be boolean, they will just represent something a little different.

In NCL, each signal (boolean value) still has 2 meanings, but they are changed. A value of 0 means NO_DATA/NULL and a value of 1 means DATA. Different signals have different Data assigned. To represent a standard boolean variable, 2 lines are needed, the encoding:

  • FALSE (0): DATA0=1, DATA1=0
  • TRUE (1): DATA0=0, DATA1=1
  • Null/Unknown: DATA0=0, DATA1=0

The new state, NULL is used when the circuit hasn’t determined a value for the line yet. Detecting completion of the circuit is then as simple as seeing if one line in each group is set. When all the outputs are assigned a value, the values are saved, and the circuit resets to NULL outputs.

Note, it is entirely possible to have more than two lines in a group. Imagine If I made a circuit that took in an 8-bit color value and outputted if it was mostly one of {Red, Green, Blue}. Instead of having 2 boolean variables for 3 states (wasting a combination), I can have 1 three-state variable: {DATA_RED, DATA_BLUE, DATA_GREEN}. When the circuit is reset, the output is unknown, so all three go to NULL, when the inputs are received and the result found, the circuit sets one of the lines. This is not that different from ‘one-hot’ encoding in synchronous logic, except that it does have a defined all-off state that carries meaning (not data, but it does indicate circuit state). In synchronous logic, such a state would be an error.

The most common encodings I’ve come across so far are 2-rail {DATA0 and DATA1} and 4-rail {DATA0, DATA1, DATA2, DATA3}, representing 1 and 2 boolean variables respectively.

Anyways, that’s the basics of NCL signaling. The thing to remember is that the signals have to go to NULL between calculations, otherwise, there’s no way to know when they are ready.

What is Asynchronous Logic?

So, what even is this blog? Well, I want to record my efforts to understand asynchronous (clockless) logic, and help others who may endeavor to do the same. So, what does asynchronous mean?

Well, in ‘traditional’ logic designs, the system uses a clock to synchronize data. In order for data to be saved and made available to the next unit, a clock edge is sent to the registers. This is needed because the signals take time to settle, and that time isn’t constant. This means that the data can’t be saved until enough time has passed to be sure everything is ready.

In Asynchronous Logic, there is no clock. Instead of waiting for enough time to have passed for the signals to be settled, the circuit is aware of when it is ready. There are several ways to accomplish this:

  • Matched Delays: The circuit is designed with a completion signal that is delayed from the inputs. The signal is used to inform the next module that the data is ready. Each module can define it’s own delay, instead of a system-wide clock period.
  • Completion Detection: Since the transistors will continue to consume power until they are done switching, it is possible to measure the current drawn, and signal completion when it drops below a certain threshold.
  • Null Convention Logic: NCL uses a different data encoding scheme to tell when data is finished. Each line is DATA or Null, so a boolean signal is represented by 2 lines (DATA0 and DATA1).

The common element of all of these is that the components/modules have to let the the next module when they are done, and the previous module when they are ready for more data. This is called handshaking. Each stage has to wait for the next to be ready for new data, and for the previous to have new data ready.

Recap:

  • Synchronous Logic requires a clock to tell it when it is ready to do the next thing.
  • Asynchronous Logic is designed to know when it is done internally, removing the need for a clock.

So, asynchronous sounds better, right? It can run at the best speed of the hardware, it doesn’t spend as much power on the clock, etc. The downside that has stood in it’s way up to this point has been that it is harder to design. However, as designs get smaller and faster, the advantages of asynchronous logic become more important.

Introduction

Hey there, everyone. I am going to be posting my experiences here as I work through my asynchronous logic design projects. I’m a Computer Engineering undergrad student at Iowa State University. I will try to answer any questions as much as I can, but this is my first try at asynchronous designs, so I won’t have all the answers.

Anyways, thank you for taking a look and I hope you learn something. If you have a request for something, let me know and I can try it. Some things I thought of, but don’t know if people want:

  • VHDL Tutorial
  • Modelsim Tutorial
  • Testing details (how to make the scripts)