Upload
lucas-singleton
View
227
Download
1
Embed Size (px)
Citation preview
The generalized measurement system – Figure 2.1
Sensingelement
Signalmodificationsubsystem
Indicator orrecorder
Measurand
ComputerE.g., for temperature measurement, could be a thermocouple or a thermistor
Computer-Based Instrumentation
Measurand
Sensingelement
Signalmodificationsubsystem
Indicator orrecorder
What’s a MUX? (Multiplexer) – Fig. 4.4
• What if we want to monitor several measurands? (several temperatures, pressure, humidity, illumination,etc.)
We need to monitor several sensors.
• In most cases, each sensor is connected to a separate channel of the computerized data acquisition system.
• The computer reads information from the various channels one at a time using a device called a multiplexer (MUX).
• The MUX is an electronic switch.
What’s a MUX? (Multiplexer) – Fig. 4.4
• The computer instructs the MUX to select a particular channel and the data are then read and processed.
• The computer then instructs the MUX to select a another channel …
Computerized Data Acquisition
• Information in computers is stored in bistable devices, called “flip-flops”.
• Flip-flops can have two possible states.• The “on” state is assigned a numerical value of
1.• The “off” state is assigned a numerical value of
0.• We need to know a little bit about binary.• The analog-to-digital converter converts an
analog signal (generally a voltage) to a digital (binary) code.
Everything I need to know I learned in kindergarten
“Sing a song of sixpence, a pocket full of rye,Four and twenty blackbirds baked in a pie”
24
2 tens + 4 ones
01 104102
Another example (decimal system)
0123 104102102101
1224
10 digits = 10 possibilities
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary numbers--what’s it worth?
1 0 1 0 1 0 1 0128 64 32 16 8 4 2 1
0000 1111 b = 15 d 1111 1111 b = 255 d
0000 1111 1111 1111 b = 4095 d
1111 1111 1111 1111 b = 65,535 d8 bits = 1 byte
Examples: converting binary to decimal
0000 0101 b = ? d
0000 1111 b = ? d
0010 1010 b = ? d
1101 0101 b = ? d
Converting decimal to binary
1 R 021
0 R 122
1 R 225
1 R 5211
1 R 11223
0 R 23246
0 R 46292
least significant bit (lsb)
most significant bit (msb)
“zero padding”
92 d = 0101 1100 b
Representing negative numbers – 2’s complement
0000000100100011010001010110011110001001101010111100110111101111
0123456789101112131415
01234567-8-7-6-5-4-3-2-1
4 bits ofnumbers
3 bits ofnumbers,
1 bit ofsign
2’s complement--hard for us, easy for the computer
1) Convert the magnitude of the number to binary-- have at least one “leading zero”
2) Invert all of the bits--0’s become 1’s, 0’s become 1’s
3) Add 1 to the result
To get positive numbers:
1) Convert the magnitude to binary--but you must have at least one “leading zero”
To get negative numbers:
1) Convert the magnitude of the number to binary-- have at least one “leading zero”
2) Leave it alone--it’s positive!
2’s complement--hard for us, easy for the computer
Example: +92
01011100
1) Convert the magnitude of the number to binary-- have at least one “leading zero”
2) Invert all of the bits--0’s become 1’s, 0’s become 1’s
3) Add 1 to the result
2’s complement--hard for us, easy for the computer
Example: - 92
01011100
10100011
10100011 +110100100