Fcaassignment1 Thomas Sampson

  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Fcaassignment1 Thomas Sampson as PDF for free.

More details

  • Words: 1,643
  • Pages: 9
Tom Sampson, Group 1Y, Games Software Development

Important Tables Button to drink mapping Button 0 1 2 3 4 5 6 7

Drink to be dispensed *test code (or “Cola”) black tea (no milk or sugar) white tea with milk (no sugar) white tea with milk and sugar black tea with sugar (no milk) lemon blackcurrant orange

Ingredient Codes code HW CW T M S Y R

ingredient hot water (for tea) cold water (for 'fruit' drinks) dried tea dried milk (for tea) Sugar syrup Yellow colouring Red colouring

Product Recipes 0 1 2 3 4 5 6 7

Cola black tea (no milk or sugar) white tea with milk (no sugar) white tea with milk and sugar black tea with sugar (no milk) lemon blackcurrant orange

CW, everything else! HW, T HW, T, M HW, T, M, S HW, T, S CW, S, Y CW, S, R CW, S, R, Y

Task 1 - Truth Table CW

HW

T

M

S

Y

R

cold water

hot water

tea

milk

sugar

yellow

red

A

B

C

Drink

0

0

0

Cola

1

0

1

1

1

1

1

0

0

1

Black tea

0

1

1

0

0

0

0

0

1

0

White tea

0

1

1

1

0

0

0

0

1

1

White tea +S

0

1

1

1

1

0

0

1

0

0

Black tea + S

0

1

1

0

1

0

0

1

0

1

Lemon

1

0

0

0

1

1

0

1

1

0

Blackcurrant

1

0

0

0

1

0

1

1

1

1

Orange

1

0

0

0

1

1

1

Tom Sampson, Group 1Y, Games Software Development Task 2 - Deriving Sum-of-Minterms i) Below I have derived the sum-of-minterms for each type of ingredient where A B and C represent the three bit binary codes sent from the keypad (ranging from 0 to 7), essentially making my proposed circuit a 3 to 8 bit decoder. NB:- It is known that CW = NOT (HW) as all drinks require exclusively CW or HW. NB:- When deriving the equation for S (Sugar), I realised that the majority of drinks needed sugar, suggesting that an equation for would be much simpler and just as effective (Alternative included below).

Alternative Equation for S

Tom Sampson, Group 1Y, Games Software Development ii) Simplifying the sum-of-minterms for HW (Hot Water) This is the original expression, derived from the truth table. The first stage I took was to use the reverse distributive law to factorise the expression, taking out as the main factor. Here, the highlighted section can be immediately recognised as a simple inclusive OR gate, however I will show my complete algebraic working below. Here you see I added “OR (B AND C)”. As this already exists immediately before, it can be added again without effecting the expression in any way, leading me to the next step of simplification. Here I used the two “B and C” terms to further factorise the expression. This helps as it provides situations where both B and C are “ORed” with their inverse. Anything “ORed” with its inverse reduces to TRUE, allowing cancellation of the two terms. Here you see the expression has been substantially reduced. My next thought was that I wanted to attempt to introduce some symmetry to the expression. I needed to somehow invert B and C (highlighted) whilst also changing the gate, suggesting the use of De Morgan's law on the highlighted area. As all the terms towards the end of the expression are all “ANDed” together the positioning of the brackets becomes irrelevant. Here I have introduced brackets around B and C in an attempt to make the implementation of De Morgan's law easier to visualise. At this stage I implemented De Morgan's law on the gate highlighted (previously and AND gate). I swapped the gate, inverted both sides of the gate, then inverted the whole gate (the three steps involved in De Morgan's law). The double inversions shown in the previous step cancel out, revealing an exclusive OR gate, with A and (B + C) as inputs. This is the final step in my simplification of the expression. The long expression in step one has now been reduced to “A exclusively ORed with B OR C”

NB:- All Brackets imply an AND gate, e.g. A(B+C) = A AND (B+C)

Tom Sampson, Group 1Y, Games Software Development Checking My Simplification At this stage my expression for HW (Hot Water) has been simplified. I am confident that I have simplified correctly but wish to check that for all variations of A, B and C, the simplified expression agrees with the original. To do this I will use another truth table to ensure that the two variations are identically matched.

HW

A

(B + C)

hot water (original form)

A

B

C

Drink

0

0

0

Cola

0

0

0

0

0

0

1

Black tea

1

0

1

1

0

1

0

White tea

1

0

1

1

0

1

1

White tea +S

1

0

1

1

1

0

0

Black tea + S

1

1

0

1

1

0

1

Lemon

0

1

1

0

1

1

0

Blackcurrant

0

1

1

0

1

1

1

Orange

0

1

1

0

As I expected, the two columns are identical and prove that the simplification process was successful, reducing the expression without affecting its validity.

Tom Sampson, Group 1Y, Games Software Development Task 3 – Drawing the circuit for the HW (Hot Water) expression Below is a diagram showing a circuit which I have devised from my simplified expression for HW (Hot Water). In addition, this circuit has an output also for CW (Cold Water). The NOT gate clearly shows that HW and CW are mutually exclusive.

Tom Sampson, Group 1Y, Games Software Development Task 4 – Forming a NAND only Expression In this task I will attempt to convert my previous expression for HW (Hot Water) into a form which utilises NAND gates only. The reason for this is to show that any circuit can be converted into “NAND only” form (also as in real life, circuits comprised of only NAND gates are cheaper and easier to produce). Below is the expression I produced in Task 3.

Although this works perfectly well (as proven in my proof table), as far as I am aware you cannot directly convert XOR (Exclusive OR) gates to NAND form. Instead to do so I will take a step backwards and re-split the expression into an OR gate, with ANDed terms either side. This is the expression with which I will begin conversion. The first thing I did was to apply De Morgan's Law individually to the two OR gates (previously located directly between B and C). To do so I switched the gate to an AND gate, inverted both sides of the gate, then negated the whole gate. On the right side two NOT lines appear (highlighted). I could cancel these out and remove them both but that would leave me with an AND gate. Instead I will leave both remaining. At this stage all which remained was to once again apply De Morgan's Law to the remaining OR gate. (replacing OR with AND, inverting both sides of gate, inverting whole gate). As you can now see, all the gates in the expression are NAND gates. I have boxed each individual NAND gate. The boxes in RED are a slight exception (see below).

The lines marked in RED invert terms. In theory this would require a NOT gate, however the characteristics of a NOT gate can be replicated easily with a NAND gate. P.T.O.

Tom Sampson, Group 1Y, Games Software Development NOT from NAND Consider the truth table for a two input NAND gate, where A and B represent the two inputs. A B 0

0

1

0

1

1

1

0

1

1

1

0

Now consider we leave the second input disconnected... NB:- Disconnected inputs always represent TRUE or 1 A B (disconnected)

0

1

1

1

1

0

Here you can see that by leaving one of the inputs disconnected we have replicated a NOT gate, where the value of input A is inverted. When referring to my final circuit diagram, any NAND gates with single inputs are used in place of NOT gates.

Tom Sampson, Group 1Y, Games Software Development Task 5 – Proving that the ORIGINAL and NAND expressions are EQUAL The table below shows the value of my NAND expression step by step to prove that the outcomes of both expressions (Original and NAND) are equal for every possible combination of A B and C (The inputs from the Keypad on the Vendium drinks machine).

ORIGINAL

0 0 0 1

1 1 1

0

1

0

0

1

1

0

0

0 0 1 1

1 0 0

1

0

1

0

0

1

1

1

0 1 0 1

0 1 0

1

0

1

0

0

1

1

1

0 1 1 1

0 0 0

1

0

1

0

0

1

1

1

1 0 0 0

1 1 1

0

1

0

1

1

0

1

1

1 0 1 0

1 0 0

1

0

0

0

1

1

0

0

1 1 0 0

0 1 0

1

0

0

0

1

1

0

0

1 1 1 0

0 0 0

1

0

0

0

1

1

0

0

As I had hoped, my NAND only expression correctly represents the original truth table required for HW (Hot Water).

Tom Sampson, Group 1Y, Games Software Development Task 6 – Drawing the circuit for the NAND only version of HW (Hot Water) Below is the NAND only circuit diagram for the following expression. The circuit shows an output for both HW (Hot Water) and CW (Cold Water).

Related Documents

Islam Sampson Lesson Plan
December 2019 3
Thomas
May 2020 35
Thomas
April 2020 34
Thomas
December 2019 67