Digital Architectures are digital circuits that implement an algorithm in hardware.
We have different representation forms for digital architectures.
Gates, functional blocks, wires etc. can be used in the design stage and for maintenance as they provide a good overview.
Describe the behavior in a mathematical way
Comparison of input and output bits.
Those Diagrams are used to show various signals over the time.
Hardware description languages are used to describe architecture in a software-like fashion. Besides the text-entry most of the tools also provide schematic entry.
If we want to design a architecture we of course need to know the function we want to implement.
Based on that function we need to decide how many bits are going in and how many bits are going out. With this knowledge we can set up a truth table.
Based on the truth table we can decide which logic-elements we need to implement the functionality. We do so by checking which input combination leads to a 1 at an output.
Example 1: Factorial
In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example:
We want to restrict the functionality to only give the factorial upon n=3. We can easily set up a table describing our desired functionality.
As we are dealing with digital architectures we need to make that binary. First we need to decide how many input/output bits we need.
n will have a maximum of “3” so 2 bits are needed.
n! will have a maximum of “6” so 3 bits are needed.
If you want to calculate how many bits you need for a certain integer and round the result to the next integer. This is the amount of bits you need.
From that we can already see that we will end up with something like this:
X1 and X0 representing the input bits whereas Y2-Y0 represent the output bits.
The box above is just describing the pinout of our architecture, now we need to specify what is happening inside.
We can translate our function into a truth table, the decimal values usually are not used within a truth table, I just added them to make life a little easier.
|X1||X0||X decimal||Y2||Y1||Y0||Y decimal|
Now we look up which input combination leads to a certain output. Let’s start with Y2 we just look at the case where Y2 is 1.
We can see that Y2 is only 1 if X1 AND X2 are 1.
In Boolean algebra we say
Y1 is 1 if X1 is 1
Y0 is 1 if X1 is 0
Bringing it together
We now have the Boolean equations:
Which directly can be mapped to hardware: