instrumentation for scientists
DESCRIPTION
Instrumentation for Scientists. 640251 - Geoff Taylor and Paul Main Brief History Bipolar and MOSFET transistors Digital Logic Primer Logic Levels, Gates, Truth Tables Decimal, Hexadecimal, Binary Arithmetic Electronic Schematic Symbols & Logic Lectures 10-12. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/1.jpg)
10 April 2008 (c) Paul Main
Instrumentation for Scientists• 640251 - Geoff Taylor and Paul Main• Brief History• Bipolar and MOSFET transistors• Digital Logic Primer• Logic Levels, Gates, Truth Tables• Decimal, Hexadecimal, Binary Arithmetic• Electronic Schematic Symbols & Logic• Lectures 10-12
![Page 2: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/2.jpg)
10 April 2008 (c) Paul Main
A Short History of Computers
• The Abacus “Computing Tray” The first mechanical calculating machine. 28?
![Page 3: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/3.jpg)
10 April 2008 (c) Paul Main
Computing Tray
• Used by Babylonian priests to keep track of their vast storehouses of grain. Still in use today. Circa 3000BC.
• In Roman times the board was given grooves to facilitate moving the counters in the proper files.
• Circa 1300BC Wire & Bead Abacus replaced the Chinese calculating rods.
![Page 4: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/4.jpg)
10 April 2008 (c) Paul Main
Computing Tray
• A modern equivalent is an Accumulator or Register: used to accumulate results of arithmetic sums.
• Uses electronic (voltage) representation of binary numbers
![Page 5: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/5.jpg)
10 April 2008 (c) Paul Main
John Napier• 1612 John Napier uses the printed decimal
point, devised logarithms and used numbered sticks - Napiers Bones - for calculating.
![Page 6: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/6.jpg)
10 April 2008 (c) Paul Main
New Improved Abacus
• 1642AD: Blaise Pascal Invented the first mechanical calculator constructed of 10 toothed gears, wheels & teeth called “Pascalene”.
• The same principle was in use in automobile’s odometer mechanism
• Same principle is the basis for all mechanical calculators.
![Page 7: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/7.jpg)
10 April 2008 (c) Paul Main
Joseph Marie Jacquard
• 1801: A linked sequence of punched cards programmed Jacquard’s loom to produce intricate weaving patterns in cloth.
![Page 8: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/8.jpg)
10 April 2008 (c) Paul Main
By Royal Commission
• 1823: The royal Astronomical Society of Great Britain commissioned Charles Babbage to produce a programmable calculating machine. He was aided by Augusta Ada Byron, the countess of Lovelace. The machine was to produce navigational tables for the Royal Navy.
![Page 9: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/9.jpg)
10 April 2008 (c) Paul Main
Babage’s Analytical Engine
1834 Babbage shifted his focus to work on The Analytical Engine. The mechanical computer stored 1000 20-digit decimal numbers and a variable program that could modify the function of the machine to perform various tasks.
![Page 10: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/10.jpg)
10 April 2008 (c) Paul Main
Babbage IO devices
• Input to his engine was through punched cards (similar to punched cards of the 1950s-80s).
• It is assumed that he obtained the idea from Frenchman, Joseph Jaquard, who used punched cards as input to a weaving machine that he invented in 1801.
![Page 11: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/11.jpg)
10 April 2008 (c) Paul Main
Dreams Faded
• After many years of work, Babage’s dream faded when he realised that the machinists of the day were unable to create the parts needed to complete his work.
• The analytical engine required 50 000 precision machined parts to allow his engine to function reliably.
![Page 12: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/12.jpg)
10 April 2008 (c) Paul Main
Michael Faraday• Son of a Blacksmith, had limited formal
education but attended public lectures and became an avid reader
• 1813 Started working life at the London Royal Institution as a laboratory assistant
• 1821 demonstrated the electric motor effect.• 1831 demonstrated EMF(current) induced
by motion of magnet by a nearby conductor.
![Page 13: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/13.jpg)
10 April 2008 (c) Paul Main
Electric Motors
• Electric Motors became available.
• Motor driven adding machines based on mechanical calculators developed by Blaise Pascal became popular.
• Electrically driven mechanical calculators were common office equipment until 1970s.
• 1844 - Samuel Morse sent a telegraph from Washington to Baltimore.
![Page 14: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/14.jpg)
10 April 2008 (c) Paul Main
George Boole
• Publishes “Laws of Thought”, describing a system for symbolic & logical reasoning which becomes the basis for computer design.
• 1858 A telegraph cable spans the Atlantic Ocean & provides service for a few days.
• 1876 Alexander Graham Bell invents, and patents, the telephone.
![Page 15: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/15.jpg)
10 April 2008 (c) Paul Main
William Shockley
• 1939 William Shockley observed P- and N- type regions in Silicon. Shockley forecast that a semiconductor amplifier was possible.
• WWII interrupted further work.• 1945: John von Neumann described the general-
purpose, stored program computer.• 1948: The invention of the Germanium bipolar
junction transistor at Bell Labs, by William Shockley, John Bardeen & Walter Brittain
![Page 16: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/16.jpg)
10 April 2008 (c) Paul Main
First Electronic Computer• June 1943: Alan Turing, Tommy Flowers &
MHA Newman made operational the first electronic computer, Colossus
• Colossus was utilised to break the cipher codes generated by the mechanical Enigma Machine; German military communication was compromised.
• British cm wavelength radar assisted to provide military superiority.
![Page 17: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/17.jpg)
10 April 2008 (c) Paul Main
The first point contact transistor
![Page 18: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/18.jpg)
10 April 2008 (c) Paul Main
The first IC
• TI commercialised the Transistor.
• In 1958 Jack Kilby at TI realised that - Resistors formed by cutting small bars of silicon, Capacitors formed by wafers metalised on both sides, and silicon transistors could all be made on the same material.
• In september 1958 he created a phase-shift oscillator - the first IC on one wafer.
![Page 19: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/19.jpg)
10 April 2008 (c) Paul Main
Intel 4004
• Intel went ahead with a general purpose logic chip capable of being programmed for instructions.
• First use of ‘Intelligence’ programmed by software. Bought the design back from Busicom.
• After 9 months development Intel’s first microprocessor is born, the 4004.
![Page 20: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/20.jpg)
10 April 2008 (c) Paul Main
4004
November 197110 Micron technology2300 Transistors108 KHz Clock60 000 Instructions/secondBus width 4 bits640 bytes addressable12 Volt. Weighed < 1 Oz. P-channel MOSFETApplications: busicom calc
![Page 21: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/21.jpg)
10 April 2008 (c) Paul Main
8008April 197210 Micron technology3500 Transistors200 KHz Clock0.06 Million Instructions Per Second (MIPS)Bus width 8 bits12 VoltAddress: 16 KbytesApps: Terminals, Calculators, Bottling Machines
![Page 22: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/22.jpg)
10 April 2008 (c) Paul Main
8080April 19746 Micron Technology4 500 transistors
2 MHz Clock 0.64 MIPSBus width: 8 bits
12 Volt Addressable memory: 64 KbytesApps: Traffic light controller,
Altair computer (first PC)Performance = 10 x 8008
![Page 23: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/23.jpg)
10 April 2008 (c) Paul Main
8085
• March 1976Clock speed: 5 MHz0.37 MIPSNumber of transistors: 6,500 (3 microns)8 bit data bus, 16 bit address bus.Typical use: Toledo scale. From measured weight and price the scale computed cost.Single 5 volt power supply
![Page 24: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/24.jpg)
10 April 2008 (c) Paul Main
8086 (8088)June 1978/1979
3 Micron Technology
5, 8 &10 MHz clock
0.33, 0.66 & 0.75 MIPS
29 000 Transistors
16/8 bit data bus20 bit address bus (1MB)
5 Volt apps: IBM PCs & Clones
performance = 10 x 8080
Segmented architecture, CISC
![Page 25: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/25.jpg)
10 April 2008 (c) Paul Main
IBMPC• 1981 The open-architecture IBM PC is launched
based on the Intel 8086
• 1980 PCDOS sold to IBM
• 1980 Ada emerged
• 1980 dBaseII popular
• 1982 First Clone PC
• 1982 AutoCAD
• 1983 TCP/IP
![Page 26: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/26.jpg)
10 April 2008 (c) Paul Main
80186 (80188)
• 1982 Original NMOS 80186
• 1987 80C186 converted to CMOS - uses 1/4 power at twice clock rate
• Used in Controllers
• Still popular
• Segmented architecture
• Software Backward Compatible with 8086
![Page 27: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/27.jpg)
10 April 2008 (c) Paul Main
80286February 19826 MHz -12 MHz clock0.9 - 2.66 MIPS
1.5 micron technology134 000 Transistors
16 bit data bus16MB Physical, 1GB Virtual
Performance =3 to 6 x 8086
Software Backward Compatible with 8086
Also V.20, AMD Cyrix etc
![Page 28: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/28.jpg)
10 April 2008 (c) Paul Main
80386October 17, 198516 MHz - 33MHz
5 to 11 MIPS1 Micron technology
275 000 Transistors Data Bus width: 32 bitsAddressable memory: 4 gigabytesVirtual memory: 64 terabytesSoftware Compatible with 8086
32 bit “Flat Mode” available
![Page 29: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/29.jpg)
10 April 2008 (c) Paul Main
80486DXApril 1989 25 MHz, 20 MIPS June 1991 50 MHz, 41 MIPS
1.2 Million Transistors
1-0.8 Micron TechnologyBus width: 32 bitsAddressable memory: 4 GBVirtual memory: 64 TB50X performance of the 8086.Software Compatible with 8086
486DX first CPU to include floating point maths co-processor.
![Page 30: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/30.jpg)
10 April 2008 (c) Paul Main
80486DX2 & DX4 - Overdrive2 or 3 times overclocked cpu core, with standard memory transfer rate.
Plugged directly into a 486SX or 486DX socket and acted as a double or triple-clocked CPU.
Eg a 33MHz cpu replaced with an DX4 processor would use a memory transfer rate of 33MHz, and an internal clock rate of 99MHz.
![Page 31: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/31.jpg)
10 April 2008 (c) Paul Main
PentiumMarch 1993
60 MHz 100 MIPS66 MHz 112 MIPS
3.1 million transistors
0.8 Micron technology
64 bit external data bus 32-bit microprocessor
32 bit address bus4 GB physical64 TB virtual
Software Compatible with 8086. BiCMOS
![Page 32: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/32.jpg)
10 April 2008 (c) Paul Main
Pentium ProNovember 1995150-200 MHz5.5 million transistors
0.35 micron technology
64 bits front side bus
64 bits to L2 cacheAddressable memory: 64 gigabytesVirtual memory: 64 terabytes256K - 1MB L2 Cache
Software Compatible with 8086
![Page 33: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/33.jpg)
10 April 2008 (c) Paul Main
NPN transistor cross-section
• IN IC form an NPN Bipolar Transistor is fabricated using a series of photolithographic and chemical processes.
• The base wafer is p-type silicon substrate around 0.25mm thick.• Boron is diffused to create a p type dopant, Phosphorous for n type.• The Yellow area is insulating SiO2. Orange – Aluminium conductors. • n+ indicates area of high conductivity & high phosphorous
concentration..
![Page 34: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/34.jpg)
10 April 2008 (c) Paul Main
BIPOLAR JUNCTION TRANSISTORSchematic circuit symbols for NPN transistorB Base E EmitterC Collector
![Page 35: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/35.jpg)
10 April 2008 (c) Paul Main
Bipolar Junction Transistor• Simple Circuit to illustrate BJT switching
for an NPN transistor
![Page 36: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/36.jpg)
10 April 2008 (c) Paul Main
MOSFET• Metal Oxide Semiconductor Field Effect Transistor
• N Channel MOSFET schematic symbol:
• G Gate
• S Source
• D Drain
![Page 37: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/37.jpg)
10 April 2008 (c) Paul Main
N CHANNEL MOSFET
IN IC form an NMOS Transistor is fabricated using a simpler series of photolithographic and chemical processes than the BJT. The resulting transistor area is also smaller.For an animation of device fabrication see: http://jas.eng.buffalo.edu/education/fab/NMOS/nmos.html
![Page 38: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/38.jpg)
10 April 2008 (c) Paul Main
MOSFET
• The voltage on the gate-source causes an electric field across the Drain-Source channel
• Above a threshold voltage, Electrons are attracted into the channel causing a increase in Drain-Source conductance.
• In digital circuits we are only interested in the switching ability of transistors.
• A voltage Vgs > threshold voltage will switch the MOSFET ON – low drain-source resistance.
• Vgs < threshold will switvh the MOSFET OFF– high drain-source resistance.
![Page 39: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/39.jpg)
10 April 2008 (c) Paul Main
MOSFET electrical properties
• N-MOS
• Behavior is
• Switch-like
• Vds fixed.
![Page 40: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/40.jpg)
10 April 2008 (c) Paul Main
N-MOS test circuit
• N-MOS switching test circuit
![Page 41: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/41.jpg)
10 April 2008 (c) Paul Main
Voltage vs 5V TTL Logic Levels
• True = Logic “1” = High Voltage Level
• False = Logic “0” = Low Voltage Level
• TTL “High” or “1” is 2.0V to 5V
• TTL “Low” or “0” is 0V to 0.8V.– Indeterminate Logic Level Between 0.8 & 2.0V– Actual Valid High & Low voltages vary
depending on the logic family & power supply voltage
![Page 42: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/42.jpg)
10 April 2008 (c) Paul Main
Inverter
• Buffer - Logic state is Maintained
• Inverter - Logic state is Inverted - NOT
![Page 43: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/43.jpg)
10 April 2008 (c) Paul Main
Inverter
• Complementary MOS (CMOS) Inverter
![Page 44: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/44.jpg)
10 April 2008 (c) Paul Main
2-Input AND Logic Symbol
Truth Table for : 2-Input AND Gate
Output will be 1, only if all inputs are 1
![Page 45: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/45.jpg)
10 April 2008 (c) Paul Main
3-Input AND Logic Symbols
Truth Table for : 3-Input AND Gate
![Page 46: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/46.jpg)
10 April 2008 (c) Paul Main
AND Gate Equivalents
• AND Gates can be constructed using OR Gates & Inverters
• DeMorgans Theorum
![Page 47: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/47.jpg)
10 April 2008 (c) Paul Main
NAND GATE
![Page 48: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/48.jpg)
10 April 2008 (c) Paul Main
2-Input OR Logic Symbol• OR - True of any input is True -
– 2-Input OR Gate Truth Table
![Page 49: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/49.jpg)
10 April 2008 (c) Paul Main
3-Input 0R Logic Symbol
• 3-Input OR Gate
![Page 50: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/50.jpg)
10 April 2008 (c) Paul Main
Inverter Equivalents
• Inverters may be constructed from NAND gates or NOR gates with the inputs tied together
![Page 51: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/51.jpg)
10 April 2008 (c) Paul Main
OR Gate Equivalents
• OR Gates can be constructed using AND Gates & Inverters
![Page 52: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/52.jpg)
10 April 2008 (c) Paul Main
XOR Logic Symbol
• Exclusive OR - True if one input is True
![Page 53: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/53.jpg)
10 April 2008 (c) Paul Main
XOR Gate
• XOR Gates can be constructed using AND gates, OR gates & Inverters
![Page 54: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/54.jpg)
10 April 2008 (c) Paul Main
Logical Notation
• AND A AND B = A B = A & B
• OR A OR B = A + B = A | B
• NOT NOT A = A = A#
• XOR A XOR B = A B = A ^ B
![Page 55: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/55.jpg)
10 April 2008 (c) Paul Main
Fundamental Data Types
Computers work in the binary number system.
The basic unit is the bit ("BInary digIT") A bit can be either 1 or 0
The other basic units are:Nybble 4 bits 0000 - 1111 (Binary), 0 - F (Hex)Byte 8 bits 0000 0000 - 1111 1111 (Binary),
00 - FF (Hex)Word 16 bits 0000 - FFFF (Hex)Longword 32 bits 0000 0000 - FFFF FFFF (Hex)Doubleword 64 bits 0000 0000 0000 0000 -
FFFF FFFF FFFF FFFF (Hex)
![Page 56: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/56.jpg)
10 April 2008 (c) Paul Main
Hexadecimal, Binary & OctalOctalHexadecimalBinaryDecimal
00000001100011220010233001134401004550101566011067701117
108100081191001912A10101013B10111114C11001215D11011316E11101417F111115
![Page 57: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/57.jpg)
10 April 2008 (c) Paul Main
Signed Number Representation
Hex numbers may be signed or unsigned.Unsigned numbers are positive only.
For 8 bits, they range from 0 .. 255 (0..FF hex)
Signed numbers are positive, negative or zero. The most significant bit is used to represent the sign of a number
For 8 bits, they range from -128 ..127 (80..7F hex)
![Page 58: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/58.jpg)
10 April 2008 (c) Paul Main
Negative Number representation
Byte numeric representation (8 bits = 1 byte)
Signed Unsigned Binary Hexadecimal Octal+127 127 0111 1111 7F 177-128 128 1000 0000 80 200-4 252 1111 1100 FC 374-3 253 1111 1101 FD 375-2 254 1111 1110 FE 376-1 255 1111 1111 FF 377
![Page 59: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/59.jpg)
10 April 2008 (c) Paul Main
Hex & Binary Notation
Hexadecimal numbers often have either a dollar sign '$‘ prefix or a ’0x' prefix as in “C”or a ‘H’ suffix (as in MASM/TASM) to indicate the number base is 16.
![Page 60: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/60.jpg)
10 April 2008 (c) Paul Main
Binary Addition0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1,1 + 1 = 0, Carry 1
![Page 61: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/61.jpg)
10 April 2008 (c) Paul Main
Binary Addition (1)
• Say for example we want to add two numbers, 5(dec) and 8(dec). Too easy!
• If we first convert these to binary we get 101(bin) and 1000(bin).
• Adding these together we get 1101(bin). • Converting back to decimal • 1101(bin)=23 + 22 + 0 + 20=8 + 4 + 0 + 1=13(dec)
• Simple - We knew that one!
![Page 62: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/62.jpg)
10 April 2008 (c) Paul Main
Binary Addition (2)
• Say for example we want to add two numbers, 7(dec) and 9(dec).
• If we first convert these to binary we get 111(bin) and 1001(bin).
• Adding these together we get 10000(bin). • Converting back to decimal • 10000(bin) = 24 = 16(dec)
• Hmm! So many ones and zeroes!
![Page 63: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/63.jpg)
10 April 2008 (c) Paul Main
Hexadecimal
• In Hexadecimal (Hex for short) we use the numbers 0..9 and A..F to represent groups of 4 bits.
• A group of four bits is called a nibble, and a group of 8 bits is called a byte.
• So any byte can be represented in 2 nibbles, or two hex digits.
• For example 11111110(binary) = 254(dec) = FE (hex)
• Now that’s easier to remember - FE FI FO FUM! And takes less letters than decimal!
• What interesting words can you make just using four hex digits?
![Page 64: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/64.jpg)
10 April 2008 (c) Paul Main
Claude Shannon
• Interests: Model Planes, Radio Controlled boats, local telegraph, juggling, unicycling, and chess…
• Studied Boole’s work on Boolean Algebra
• Graduated with degrees in Electrical Engineering and Mathematics.
• Utilised and extended boolean algebra to operate on relays
• AND Invented the base 2 adder!• He also contributed to cryptography theory!
![Page 65: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/65.jpg)
10 April 2008 (c) Paul Main
Full Adder (1)
• Full Adder Truth Table
Who invented the base 2 adder?
![Page 66: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/66.jpg)
10 April 2008 (c) Paul Main
Full Adder (2)
• A Full Adder adds two bits, A0 & B0, plus the Carry-In as shown creating a Bit 0 Sum and Carry Out.
Carry
In
Carry Out
Bit 0 Sum
![Page 67: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/67.jpg)
10 April 2008 (c) Paul Main
8 Bit Adder• 8 Full adders can be cascaded to
form an 8-bit ADDer
• The AVR assembly language instructions “ADD” and “ADC” configures the ALU to use the logic shown.
• Carry in is set to 0 for ADD.
• Carry in is set to CF for ADC.
![Page 68: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/68.jpg)
10 April 2008 (c) Paul Main
One's complementInvert bits - The NOT operation is performed
invert 1101 0101 -> 0010 1010
![Page 69: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/69.jpg)
10 April 2008 (c) Paul Main
Two's complementTake one's complement of a number and add 1
convert from positive to negative numberconvert from negative to positive number
Example:
Negate 1101 0101
-> 0010 1010 + 0000 0001
= 0010 1011
![Page 70: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/70.jpg)
10 April 2008 (c) Paul Main
Two's complement1) Start with 0000 0011One's complement 1111 1100
Add 1 1111 1101
2) Start with 0000 0000 One's complement 1111 1111
Add 1 0000 0000
![Page 71: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/71.jpg)
10 April 2008 (c) Paul Main
Equivalent Circuits• To make a TTL inverter requires a single
NPN transistor, diode and 2 resistors.• To make a simple Diode-Nor gate requires a
single transistor, 2 diodes and 3 resistors.• It is possible to create AND gates using NOR
gates and Inverters. (deMorgans theorum)• Example Inverting the inputs to a NAND gate -> OR gate.
• Work Example - OR, AND, MUX, Latch
![Page 72: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/72.jpg)
10 April 2008 (c) Paul Main
Terminology - Edge transitions
• Logic “1” -> Logic “0” = Falling Edge
• Logic “0” -> Logic “1” = Rising Edge
![Page 73: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/73.jpg)
10 April 2008 (c) Paul Main
Memory Elements: 1 Bit Latch
• Latches can be created using NAND Gates
![Page 74: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/74.jpg)
10 April 2008 (c) Paul Main
Registers
• A register can be created using an array of latches with their gates connected together..
• The lower nibble of R01 R01.0..R01.3 can be created using the latches as shown here.
![Page 75: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/75.jpg)
10 April 2008 (c) Paul Main
AVR Core Architecture
![Page 76: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/76.jpg)
10 April 2008 (c) Paul Main
AVR Register Set (1)
• The AVR contains 32 General Purpose working registers - “Accumulators”
• The ALU supports 8 & 16 bit operations.
![Page 77: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/77.jpg)
10 April 2008 (c) Paul Main
AVR Register Set (2)
![Page 78: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/78.jpg)
10 April 2008 (c) Paul Main
AVR Register Set (3)
• The AVR contains 32 General Purpose working registers.
• Most instructions have full access to all the registers for 8 or 16 bit operations.
• The X, Y and Z registers have a special function. They can be set to index anywhere in memory, including any register as they are also mapped into memory.
• I.e. X, Y and Z they can be used as pointers.
![Page 79: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/79.jpg)
10 April 2008 (c) Paul Main
AVR Register Set (4)
![Page 80: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/80.jpg)
10 April 2008 (c) Paul Main
The status register
• In computer code we may wish to test if variables A and B are equal.
• IF A=B, this means A – B = 0.• So the compiler creates code to load registers with
the values of variables A and B, perform subtraction.
• If the result is Zero the “Zero flag” is set.• Most computers can branch based on a “Zero flag”.
![Page 81: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/81.jpg)
10 April 2008 (c) Paul Main
Status Register
Example “C” CodeIf (A == B) { // A EQUALS B i++; } else { // A NOT EQUAL B
}Assume variables A, B and i
are of type char (1 byte).
Equivalent Assembly Code
LD R0, A ; A -> R0
LD R1, B ; B -> R1
SUB R0, R1 ; SUBTRACT B-A
BNEQ ABNEQUAL ; SKIP if not eq.
LD R0, I ; i++;
INC R0
ST R0, I
ABNEQUAL:
![Page 82: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/82.jpg)
10 April 2008 (c) Paul Main
Condition Codes Register: ZERO FLAG
![Page 83: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/83.jpg)
10 April 2008 (c) Paul Main
AVR Status Register
• Bit#7 - Interrupt - Cleared on interrupt• 6 - T - biT for Bit Load & Store instructions• 5 - H - Half Carry
• 4 - S - Sign• 3 - V - oVerflow• 2 - N - Negative• 1 - Z - Zero• 0 - C - Carry• From Pages 9 & 10 of ATMEGA128 manual
![Page 84: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/84.jpg)
10 April 2008 (c) Paul Main
Multiplexor - Data Selector
• Multiplex (MUX) many inputs to one output
• Switch selects the one signal source from many input signals.
• Like Stereo HiFi source selection switch
![Page 85: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/85.jpg)
10 April 2008 (c) Paul Main
Two Input Multiplexor
Output = (Input0 & Select#)
| (Input1 & Select)
Two Input MuxTruth Table
OutputSelectInput 00Input 11
![Page 86: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/86.jpg)
10 April 2008 (c) Paul Main
Four Input Multiplexor4 Input MultiplexorTruth TableSelect Line:
Output01Input 000Input 110Input 201Input 311
![Page 87: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/87.jpg)
10 April 2008 (c) Paul Main
Eight Input Multiplexor
Eight Input MultiplexorTruth Table
OutputSelect Line:012
Input 0000Input 1100Input 2010Input 3110Input 4001Input 5101Input 6011Input 7111
![Page 88: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/88.jpg)
10 April 2008 (c) Paul Main
74F151 8-Input MUX
![Page 89: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/89.jpg)
10 April 2008 (c) Paul Main
74F151 8-Input MUX
Pin Names and Loading / Fanout
![Page 90: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/90.jpg)
10 April 2008 (c) Paul Main
Mux vs DeMux
![Page 91: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/91.jpg)
10 April 2008 (c) Paul Main
74LS138 8-Output DEMUXDe-Multiplex one input to many outputs -Reverse operation of a multiplexor74LS138 Truth Table
![Page 92: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/92.jpg)
10 April 2008 (c) Paul Main
DeMultiplexor• The 74LS138 can be
implemented by the logic shown.
• The 54LS138 is identical in function, but can operate over the “Mil-spec” -55°C to 125°C Temperature Range.
• The 74LS138 can operate over the Commercial 0°C - 70°C Temperature Range.
![Page 93: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/93.jpg)
10 April 2008 (c) Paul Main
ASCII & Extended IBM Graphics Character Set
00102030405060708090A0B0C0D0E0F0
0123456789ABCDEF
![Page 94: Instrumentation for Scientists](https://reader035.vdocuments.net/reader035/viewer/2022062222/56815164550346895dbf8f67/html5/thumbnails/94.jpg)
10 April 2008 (c) Paul Main
Acknowledgments & References• Altium Protel 98, DXP or Altium 6 to create these schematic
diagrams and timing diagrams.
• Logic Timing Diagrams are from Texas Instruments (TI) Logic Selection Guide - Digital Design Seminar
• National Semiconductor data sheets 74LS138.
• http://www.sea.vg/mic/2007/Atmel/Atmega128ManualDoc2467.pdf
• IEEE timeline of Computing
• Interfacing Sensors to the IBM PC.Tompkins & Webster
• Microelectronic Circuits - Sedra & Smith
• Paul Main AVR lecture notes - sea.net.au - October 2007