Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This small programming assignment builds on Assignment 1 and is intended to help you apply what you have learned about logic, problem-solving, abstraction, and modularization.

image text in transcribed

This small programming assignment builds on Assignment 1 and is intended to help you apply what you have learned about logic, problem-solving, abstraction, and modularization. You will be emulating a circuit by completing a Python function which returns the correct Boolean output for the specified number of Boolean inputs, along with a Boolean algebra statement, a testing table, diagram, and Python function of your circuit. What you must do You'll need to emulate a circuit meeting the following requirements: Emulate a circuit that takes in 4 inputs (A,B,C,D) and whose output Q is True only when exactly 1 of the 4 inputs is False. For example, if A, B, and D are True and C is False, the output Q should be True also. If A,B,C, and D are all True, Q should be False. In other words, if any three of the four inputs are True while the other is False, the output should be True. You'll be representing your circuit in four ways: 1. A Python function - Write a function which takes in four Boolean inputs and returns one Boolean output meeting the requirement above. You will need to "chain" the gates emulated in this Repl . - You only need to write one function. You should not define your own gate functions, alter the gate functions (e.g. to take in more than 2 inputs), or use Python operators directly. As an example, to call an AND gate you would use gate1 = gate_and (a,b) \#lowercase letters for the variables are fine - You do not have to write your function inside the Repl if you would rather create a local project, although the function you turn in should work if run within the Repl (meaning, the functions you call must have the same names as the ones defined, etc.). You can copy and paste the code from the Repl into an IDE if you want to build your function there. 2. A Boolean Algebra equation - Write a statement using the symbols defined in the Exploration: Reasoning and Logic (i.e., ,, ). Use the variable names A, B, C, and D for input and Q for output. (Note that even though you can use XOR, NAND, and NOR for the diagram and Python portions, you cannot use any XOR, NAND, or NOR symbols directly in this section.) 3. A Truth Table - Create a truth table with columns A, B, C, D for input, Q for expected output, and R for actual output produced by your Python program. Fill in the cells showing possible input combinations, the expected output Q for each combination, and the actual output. 4. A Circuit Diagram - Draw or generate a diagram of your circuit using the conventions laid out in the Exploration: Reasoning and Logic page. Use only the gates defined on that page (i.e., AND, OR, NAND, NOR, XOR, NOT). - Make sure your gates and inputs are labeled. You may find that the sections are easier to complete in a certain order (other than the one listed). For example, it might be easiest to do the diagram first, and then fill in your truth table. If you find yourself struggling with one section, I recommend moving on to another and then coming back to it later. All of the sections should be consistent in terms of output and labeling. You'll include a brief (no more than a few paragraphs) description of your problem-solving process, including the order in which you attempted the four representations. You'll need to have reviewed the content in the exploration pages on Data, Logic, and Python functions. Hint: Remember that inputs can be mapped to multiple gates

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions