Exam Prep Flashcards
What is fixed precision?
A tool used by microprocessors or computing systems to limit the numbers to a fixed number of bits
What is overflow?
When two numbers are added or subtracted and the correct result is a number that is outside of the range of allowable numbers for that precision
What is signed magnitude representation?
A way to sign integers. Put a 1 in front of a binary number to make it negative, a 0 to make it positive
What is ones complement representation?
A way to sign integers. Invert (replace 0s with 1s, vice versa) a binary number to it’s negative form
What is twos complement representation?
A way to sign integers. Use ones complement, but add 1 to its least significant bit
N bits can represent ___ different values
2^N
Define system clock
A component of a microcontroller. Provides a stable and consistent beat for the embedded control system
Define the central processing unit (CPU)
A component of a microcontroller. A multifunction math engine that takes commands stored in memory and uses them as an instruction list to accomplish tasks
Define the register
A component of a microcontroller. A digital location for holding temporary data, instructions or addresses
Define memory
A component of a microcontroller. Used to hold instructions and data
Define Line I/O
A component of a microcontroller. Standard input/output functions. Allows data to be transferred to and from the microcontroller
Define timer
A digital memory location that is updated or counted (incremented or decremented) at predetermined times
Define the accumulator (A) (a.k.a. working register)
A register type. This is where data for an input to the ALU is temporarily stored.
Describe how an accumulator system operates in steps
Example: Sum
- One number is fetched from memory and placed in the accumulator
- Second number is fetched from memory and placed in accumulator
- Result is placed into accumulator
Define status (a.k.a. condition code or flag register)
A register type. Contains information related to the result of the latest process carried out in the ALU. Each bit, called a flag, has a special significance. After an operation, each flag (bit) is set (1) or reset (0) to indicate a specific status
Define program counter (PC) (a.k.a. instruction pointer)
A register type. Used by the CPU to keep track of its position in a program. Contains the address of the memory location that contains the next program instruction. Updated after each instruction is executed. Program is executed sequentially unless an instruction alters the program counter
Define memory address register (MAR)
A register type. Contains the address of data. Example: Sum
- MAR loaded with address of first number
- Data at that address is then moved to the accumulator
- Memory address of second number loaded
- Data at the address is then added to data in the accumulator
- The result is then stored in a memory location addressed by the MAR
Define instruction register (IR)
A register type. Stores an instruction. Used by CPU to store an instruction after fetching it from memory, prior to decoding and execution
Define stack pointer register (SP)
A register type. Contents form an address which defines the top of the stack in RAM. The stack is a special area of the memory in which program counter values can be stored when a subroutine is being executed
Define general-purpose registers
A register type. May serve as temporary storage for data and addresses. May also be used in operations involving transfers from various other registers
Define buses
The bus is a shared set of communication lines that serves as the central nervous system of the computer. Data, address, and control signals are shared by all system components via the bus
Define data bus
Used to communicate words to and from data registers in the various system components
Define address bus
Used to select devices on the bus or specific data locations within memory
Define control bus
Transmits read and write signals, the system clock signal, and other control signals such as system interrupts
What is ROM?
Read Only Memory. Used for permanent storage of data, programmed at time of manufacture, don’t lose memory when power is removed
What is PROM?
Programmable ROM. ROM chips that can be programmed by the user. Cannot be reprogrammed
What is EPROM?
Erasable and Programmable ROM. Programmable and contents can be altered, cells store charges, programmed by producing a pattern of charged and uncharged cells, memory erasedb by shining ultraviolet light through quartz window
What is EEPROM?
Electrically Erasable PROM. Memory erased by applying a relatively high voltage
What is FLASH?
Similar to EEPROM with much larger capacities. Generally addressed by blocks rather than words
What is RAM?
Random Access Memory. Can be read or written to, holds data temporarily. Once power is removed, data in memory is lost
What is firmware?
Refers to programs stored in ROM
What is software?
Refers to programs stored in RAM. Must be loaded into memory each time system is powered up
What does the following assembly language program do?
LOAD 04 ADD 03 STORE 00 09
This program adds the numbers 4 and 3 together and stores the result in address 9. “LOAD 04” loads the accumulator with data 04. “ADD 03” takes data 03 into the ALU and adds the accumulator contents to it, result is copied to accumulator. “STORE 0009” stores accumulator content at address 0009.
Note: Addresses in this program are 16-bits long, so each address is split into high and low bytes
This is probably not super necessary to know anyways
Binary numbers presented to the microprocessor are called ________________
Machine language
Define mnemonics
Because programming in machine language is nearly impossible, every manufacturer of microcontrollers defines a three or four-letter code that describes the function of each instruction. These are called mnemonics, and programs written in mnemonics are referred to as assembly language
Define pipelining
Makes programs run faster. Since most microcontrollers fetch and execute instructions sequentially, pipelining is used to allow fetch and execution actions to overlap
Define an input/output (I/O) operation
A way for the CPU and external world to transfer data
Define peripheral device
The pieces of equipment that are interfaced to the I/O ports of a microcontroller
Define polling
A way to verify that the data retrieved from an I/O device is valid. Status bit is continually checked, CPU must wait for desired condition
Define interrupt
A way to verify that the data retrieved from an I/O device is valid. Interface chip sends interrupt to CPU when it has valid data; operation of CPU is suspended to handle interrupt
Define digital I/O
Digital input consists of reading the state on a given pin or line (bit) or group of pins (word). Digital output involves setting the output condition of a pin (or pins) to GND (0) or VCC (1)
Define multiplexers (MUX)
Essentially an electronic switch. Expands the number of available I/O lines. Could introduce errors such as crosstalk (adjacent channels interfere with channel being read), or transfer (output voltage not exactly the same as input)
Define serial I/O
Allows communication of data between devices one bit at a time. Utilize two or more digital I/O pins (TX and RX usually at minimum). Popular methods include:
USB (Universal Serial Bus)
CAN (Controller Area Network)
SPI (Serial Peripheral Interface)
I^2C Bus (Inter-IC Bus)
What are a few Arduino commands?
pinmode(pin, mode): configures specified pin as input or output
digitalRead(pin): reads value from specified pin, returned as HIGH or LOW
digitalWrite(pin, value): sets pin to value (HIGH or LOW)
Define Analog-to-Digital Converter (ADC)
Hybrid device with both an analog and digital side. Converts an analog voltage into a binary number through a process called quantization
Define resolution
The smallest increment of voltage that can be resolved by the ADC. The resolution per bit, Q, depends on the full-scale voltage range and the number of bits of the converter:
Q=E/(2^M)
E: full-scale voltage range
M: number of bits of the ADC
Note: Also a static characteristic in sensors (discussed later)
Define saturation error
Result from finite upper and lower limits of voltage response for an ADC. If the voltage exceeds upper or lower limits, the converter saturates (recorded signal does not vary with input)
Define conversion error
ADC converters may suffer from slight nonlinearity, zero offset errors, scale errors, or hysteresis. Errors are a direct consequence of the input quantization method
What are the most common ADC types?
Successive approximation converters, ramp converters, dual-ramp converters, and parallel or flash converters
Define successive approximation ADC
Most common type of ADC. Uses a trial-and-error approach for estimating the input voltage to be converted. This process requires one clock tick per bit. Increasing the number of bits to lower quantization error results in a direct increase in conversion time. Noise is the principle weakness of this type of ADC, particularly at the decision point for higher-order bits
Define ramp converters
Use the voltage level of a linear reference ramp signal to discern the voltage level of an analog input signal. Good for high accuracy, low level (<1 mV) measurements. Reference signal starts at zero and is increased at set time steps. At each time step, the ramp level is compared with the input voltage level
Define dual ramp converters
Similar to ramp converter, uses both a charge cycle and discharge cycle. Most accurate ADC type. Conversion times are relatively slow (4-8 ms), often used for digital voltmeters
Define parallel or flash converters
Fastest type of ADC (1 clock cycle). Typically used in oscilloscopes and spectral analyzers. Also expensive
What are some common Arduino commands for analog I/O
analogReference(type): configures the reference voltage used for analog input. type = DEFAULT, INTERNAL or EXTERNAL. DEFAULT: supply voltage, INTERNAL: built-in reference, EXTERNAL: defined by the voltage applied to the AREF pin
analogRead(pin): reads value from specified analog pin. returns int ranging from 0 to 1023 or 0 to 4095
analogWrite(pin, value): Approximates analog voltage on pin by writing a PWM square wave (f = 490 Hz). value sets the duty cycle (0 = always off; 255 = always on)
dacWrite(pin, value): value is the digital value to be converted, ranging from 0 to 255
Define duty cycle
How long the output is high during one period, varying the duty cycles will vary the output voltage in PWM
Define version control
Refers to the management of changes to documents, programs, and other information stored in computer files. Typically only stores differences between file versions “diffs”, rather than entire copy of file
Define a version control system (VCS)
Stores all revisions made to files, along with timestamps
What are the advantages of using version control?
Backup and Restore: Files are saved as hey are edited, and you can jump to any moment in time
Synchronization: Allows people to share files and stay up-to-date with the latest version
Short-Term Undo: Trying something out with a file and messed it up? Throw away your changes and go back to “last known good” version in the database
Long-Term Undo: Really bad screw up, you can go back to the very beginning of the screw up
Track Changes: Can leave messages explaining why certain changes were made, makes it easy to see how file has changed over time
Track Ownership: A VCS tags every change with the name of the person who made it
Sandboxing: If you’re making a big change, you can make temporary changes in an isolated area, test and work out the kinks before “checking in” your changes
Branching and Merging: Larger sandbox, can branch a copy of your code into a separate area and modify it in isolation (tracking changes separately), can merge back later
Define centralized version control
Traditional version control system; server with database maintains repository, clients have a working version. Challenges include multi-developer conflicts, client/server communication
Define distributed version control
Authoritative server by convention only, every working checkout is a repository, get version control even when detached, backups are trivial
What are some version control terms and their definitions?
Repository (repo): The database storing the files in VC
Add: Put a file into the repo for the first time (i.e. begin tracking with version control)
Revision: What version a file is on
Check out: Set the current version of the file from the repo
Commit: Write changes to repository
Head: The latest revision in the repo
Branch: Establishes a “fork” of the code that may be developed independently
Merge: Combining changes from multiple branches
Define git
Open source, multiplatform, very fast, distributed VCS
Define transducer
A device that converts variations of one quantity into those of another (same or different form). Transducer encompass both sensors and actuators
Define sensor
A device that detects a change in a physical stimulus and turns it into a signal that can be measured or recorded
Define actuator
A device that produces an observable output
What are the six signal types? (Hint: they’re all based on types of energy)
- Radiant: Radio waves, visible light, infrared
- Mechanical: Motion and forces (displacement, velocity, acceleration, etc.)
- Thermal: Kinetic energy of atoms and molecules
- Electrical: Current, voltage, resistance, etc.
- Magnetic: Magnetic flux, field strength, etc.
6: Chemical: Chemical composition, pH value, etc.
What are the three main types of transducer signals?
- Analog: Signal is a proportional representation, or analogy, of the original parameter
- Digital: A function is used to represent the original parameter value
- Coded digital: A parallel digital signal represents the original parameter signal
Define static charactersistics
Relate to performance, given a steady-state input condition
Define dynamic charactersistics
Describe behaviour between the time that the input value changes and the time at which the steady-state condition is achieved
Define range and span
A static characteristic. Range defines the limits between which the input can vary (ideal would be from negative infinity to positive infinity), in general, a wide range implies low resolution and low accuracy. Span is just maximum value minus minimum value (i.e. -3 to 3, span = 6)
Define error
A static characteristic. Difference between the result of the measurement and the true value of the quantity being measured (error = measured value - true value)
What are the two types of errors and their definitions?
- Bias error: Consistent and repeatable. Could be calibration issues, loading (intrusive sensor, alters measurand), and variables other than the measurand. Bias error = average of readings - true value
- Precision error: Random. Precision errors originate from the sensor itself, caused by uncontrolled variables in the sensing process
Define accuracy
A static characteristic. Measure of how closely a measured value agrees with the true value. Accuracy (%) = 100 - (reference value - measured value)/(reference value) * 100
Define precision
A static characteristic. Clarity or sharpness of a measurement, closely related to accuracy
Define sensitivity (scale factor)
A static characteristic. Ratio of the change in input to the change in output. Often a key factor in sensor selection
Define hysteresis
A static characteristic. Providing a different output value for the same input, depending on whether that value was reached by a continuously increasing change or a continually decreasing change
Define threshold
A static characteristic. Smallest input change from zero that makes an output change discernable. Note: Dead zone is the total range of input over which the output remains zero
Define stability
A static characteristic. The ability of a sensor to give the same output when used to measure a constant input over a period of time. Expressed as a percentage of the full output range. Described by drift (shifts in measured reading while physical variable remains unchanged) and zero drift (drift at the zero value of the variable). Caused by sensitivity to factors other than the measurand and internal sensor changes
Define repeatability
A static characteristic. Ability to produce the same output for repeated applications of the input value. Includes measurement process and environment, same physical variable and conditions, every time
Define linearity
A static characteristic. A measure of the “steadiness” of sensitivity throughout the active range (dx/dy constant over entire range)
Define input/output impedances
A static characteristic. Minimize loading effects: Changing behaviour of the system that device is attached to, changing process
Define response time
A dynamic characteristic. Time that elapses before 95% of actual value is reached after a step input is applied
Define time constant
A dynamic characteristic. 63.2% of response time, measure of inertia, how fast sensor responds to changes in input, the bigger this value = slower the response
Define rise time
A dynamic characteristic. Time taken for output to rise to some specified percentage of steady-state output
Define settling time
A dynamic characteristic. Time to settle within a specified percentage of the steady-state value
Describe the process of sensor selection
- Identify the nature of the measurement required:
Variable to be measured Nominal range Range of value Accuracy required Required speed of measurement Reliability required Environmental conditions
- Identify the nature of the output required from the sensor
Needed to determine signal conditioning requirements
- Identify possible solutions, should consider:
Range Accuracy Linearity Speed of response Reliability Maintainability Life Power supply requirements Ruggedness Availability Cost
What are the categories of electronic sensors
- Go/No Go sensors - On/Off sensors
2. Analog sensors - output proportional to stimulus
Define microswitch
Commonly used, small electric switch that requires physical contact and a small operating force to close the contacts
Define sensing resistors
Resistance proportional to target measurement (angular/linear position, force/pressure, temperature, light intensity, sound intensity)
Define potentiometer
Converts mechanical input (position of wiper terminal) into electrical signal by potential/voltage divider principle
Define force sensing resistors (FSR)
Polymer thick film (PTF) devices which exhibit a decrease in resistance with an increase in applied force. In general, FSR response approximately follows an inverse power-law characteristic
Define thermistor
Temperature sensitive resistors. Resistance of a thermistor decreases with increasing temperature
Define photoresistors
Resistance varies with light intensity
Define electromagnetic spectrum
The distribution of electromagnetic radiation according to energy, frequency, or wavelength
Define PN junction light detectors
All PN junctions are light sensitive, largest family of photonic semiconductors, most are made from silicon and can detect both visible light and near-infrared, photodiodes are PN junctions specifically designed for light detection
Define photodiodes
Essentially reverse-biased diodes with a transparent envelope. Photodiodes generally have a fast response, have a peak response in the near infrared region, response in the visible spectrum is often significantly weaker
Define phototransistors
Photo-conductive detector that allows current from an external power supply to flow in response to light. A series resistor is necessary to ensure that current flows through the phototransistor
Define digital optical encoders
Optical rotary encoders use geometric masking which allows light to pass through unmasked slits and be detected by photodetectors on the other side of the disk. Designed to produce a digital word that distinguishes 2^N distinct positions of the shaft, where N is the number of tracks
Define gray code
One track (bit) changes state for each count transition
Define binary code
multiple tracks (bits) can change during count transitions
Define incremental (relative) encoders
Uses only two tracks and two sensors. Tracks A and B are a 1/4 cycle out of phase with one another yielding quadrature signals
Define IR distance measuring sensors
Sharm analog output distance measuring sensor. There are three models with different ranges (4-15 cm, 10-80 cm, 20-150 cm)
Define sharp IR distance sensors
Uses a lens and a position sensitive detector (PSD) to accurately determine distance to object
What is the process for selecting a photodetector?
A few considerations when selecting a photodetector include:
- Is the device sensitive enough for the application?
- Do the wavelength characteristics of the detector match the source?
- Is the device cost effective?
- Is there a clear path between the light source(s) and detector?
- Is the device electrically compatible with the rest of the circuit
Define ultrasonic sensors
Noncontact measurement of distance to nearby objects. A single transducer may operate as a source/sensor pair. Transducer generates a short burst of high frequency sound, travels as a narrow cone, objects in path of sound are reflected back to sensor, same transducer acts as a microphone and converts to an electrical signal, time between pulse and echo are measured