semester 1 Flashcards
(24 cards)
What are smart systems?
Smart systems use sensors to gather data, transmit it to control units that describe and analyse a
situation, to make decisions and control actuators to perform “smart” actions.
What is a sensor?
A device that measures a physical property
What are control units?
Computers or microcontrollers that can be programmed to perform advanced functions.
Actuators
Devices that affect the physical environment by doing work (actual work)
Binary
Information stored in the form of 0 and 1
How is Boolean function similar to binary?
In both systems there are two states 0 and 1 vs true and false
What is the Boolean function?
The concept of boolean is that there are only two possible states true and false.
What are the boolean gates?
Boolean gates are components that take one or more inputs and implement a Boolean function (determining true or false)
The types of Boolean gates?
(DULL ROUND TEETH) And gate- both streams of information has to be true to get a true output
(SHARK TEETH) Or gate- either one or both has to be true to get true output
(TRIANGLE) Not gate- Inverts the input
What are truth tables used for?
They are used to represent the result of a logical expression (Boolean) for all possible combinations of the input values.
Logical Circuits
A graphical way to represent logic (like a flowchart) using logical actions and gates.
What are:
Bit-
Byte-
ASCII
Bit
A bit of information stores a single binary value
Byte
8 bits of information form a byte.
ASCII
The American Standard Code for Information Interchange is a data interchange format that allows the encoding of letters, symbols, etc into number equivalents that can be stored as binary values.
Comments
Commenting in python is done by putting a # hash symbol before text. Anything after the # is considered a comment on the same line.
We use comments to write ‘notes’ or ‘document’ sections of code.
Console
The console is where the python interpreter runs (i.e. command line). This provides an interactive means to talk to Python (via input provided).
Output
We can display output to the user on the console using the print() syntax.
Data Types
Python allows for storage and use of certain types of data (data types). The basic ones we talked about here are: string (i.e. text), integers (whole numbers), and floats (decimals).
Variables
We can use a variable to store values temporarily (they exist in memory while your python program is running).
input
We can get input from the user on the console using the input() syntax. Note that the value provided from input() is always a string.
Remainder
x%y
Rounding
round(x, precision)
power
x**y
get data types
type(x)
Converting between data types
to intiger- int(x)
to float- float(x)
to string- str(x)
Module
Value of PI math.pi Degrees to radians math.radians(x) Radians to degrees math.degrees(x) Sine math.sin(x) Cosine math.cos(x) Tangent math.tan(x) Square Root math.sqrt(x) Round down math.floor(x) Round up math.ceil(x)