Question

I have this project listen below and im not sure where to start maybe someone can give me a few pointers or perhaps point me in the right direction of starting this? Thanks!!

Input: A, B = octal digits (see representation below); Cin = binary digit

Output: S = octal digit (see representation below); Cout = binary digit

Task: Using binary FAs, design a circuit that acts as an octal FA. More specifically, this circuit would input the two octal digits A, B, convert them into binary numbers, add them using only binary FAs, convert the binary result back to octal, and output the sum as an octal digit, and the binary carry out.

Input/Output binary representation of octal digits

Every octal digit will be represented using the following 8-bit binary representation:

Octal 8-bit Input Lines:

Digit: 0 1 2 3 4 5 6 7
0       1 0 0 0 0 0 0 0
1       0 1 0 0 0 0 0 0
2       0 0 1 0 0 0 0 0
3       0 0 0 1 0 0 0 0
4       0 0 0 0 1 0 0 0
5       0 0 0 0 0 1 0 0
6       0 0 0 0 0 0 1 0
7       0 0 0 0 0 0 0 1

You are required to design the circuit in a structured way.

Was it helpful?

Solution

Ok, so essentially you're being asked to design a 8-to-3 encoder and a 3-to-8 decoder. Because you're given FAs to work with that's not the point of the assignment.

First we need to define how an encoder and decoder function. So we construct a truth table:

Encoder:

Input    | Output
01234567 | 421
-----------------
10000000 | 000
01000000 | 001
00100000 | 010
00010000 | 011
00001000 | 100
00000100 | 101
00000010 | 110
00000001 | 111

and the decoder is just the reverse of that.

Next, how do we construct our encoder? Well, we can simply attack it one bit at a time.

So for the 1s digit we have if input bit 1, 3, 5 or 7 is set then it's 1, otherwise it's 0. So we just need a giant OR with 4 inputs connected to 1, 3, 5 and 7.

For the 2s digit we need the OR gate connected to 2, 3, 6, 7. Finally for the 4s gate, connect them to 4, 5, 6, 7. This doesn't do any error checking to make sure extra bits aren't set. Though, the behavior in that case seems to be undefined by spec, so it's probably OK.

Then you take your three lines and feed them to your adders. This is easy so I won't get into it.

Finally you need a decoder, this is a bit more tricky than the encoder.

Let's look at the decoder truth table:

Input | Output
421   | 01234567 
----------------
000   | 10000000
001   | 01000000
010   | 00100000
011   | 00010000
100   | 00001000
101   | 00000100
110   | 00000010
111   | 00000001

This time we can't just use 3 or gates and call it a day.

Let's write this down in C-like code:

if (!input[0] && !input[1] && !input[2])
  output[0] = 1
if (input[0]  && !input[1] && !input[2])
  output[1] = 1
if (!input[0] && input[1]  && !input[2])
  output[2] = 1
if (input[0]  && input[1]  && !input[2])
  output[3] = 1
if (!input[0] && !input[1] && input[2])
  output[4] = 1
if (input[0]  && !input[1] && input[2])
  output[5] = 1
if (!input[0] && input[1]  && input[2])
  output[6] = 1
if (input[0]  && input[1]  && input[2])
  output[7] = 1

So, it looks like we're going to be using 8 3 input AND gates, and three NOT gates!

This one is a bit more complicated, so I made an example implementation:

3-to-8 decoder

OTHER TIPS

If the conversion is to be done by hand in class, you can try the following way.

Conversion of Octal to Binary:

To convert octal to binary, replace each octal digit by its binary representation. Example: Convert 518 to binary: 58 = 1012 18 = 0012 Therefore, 518 = 101 0012.

Conversion of Binary to Octal:

The process is the reverse of the previous algorithm. The binary digits are grouped by threes, starting from the decimal point(if present) or the last digit and proceeding to the left and to the right. Add leading 0s (or trailing zeros to the right of decimal point) to fill out the last group of three if necessary. Then replace each trio with the equivalent octal digit.

Example, convert binary 1010111100 to octal: (Adding two leading zero's, the number is 001010111100) 001 = 1, 010 = 2, 111 = 7, 100 = 4 Therefore, 1010111100 = 1274

To convert to and from octal you can use an encoder & decoder pair (http://www.asic-world.com/digital/combo3.html). The 3 bit adder can be made from chaining the 3 FAs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top