Download presentation
Presentation is loading. Please wait.
1
COMP 1321 Digital Infrastructure
Richard Henson University of Worcester October 2017
2
Week 2: Binary Numbers and CPUs
Objectives of session: Explain the CPU as the fundamental part of the computer Explain why binary numbers are fundamental to computing Convert between binary and hexadecimal numbers Explain the structure of typical CPU
3
Origins of the CPU All about processing data Needs a mechanism for
adding data (input) removing processed data (output) storing data outside the CPU In early days (e.g. Bletchley Park) data input, output, movement, storage were all paper-based… very slow!
4
Binary Numbers Base 2… based on symbols 0 and 1
perfect fit with Boole & logic states (1850s) surprising no-one before Shannon (1930s) grasped this idea To represent binary in real world… need “on/off” switches mechanical… slow but gotta start somewhere… (!)
5
Electrical Storage of Binary?
Possible using: Relays on – magnet has current/off – magnet no current binary numbers relay off = 0 relay on = 1
6
Shannon & Relays 1938: first scientist to use Boolean Logic with relays: on/off 1/0 realised binary numbers could replace decimal numbers & represent real data values Figured that relays could be wired together to create logic gates and do Boolean Algebra (!) problem… relays slow
7
A Fast Switch Electronic… But once working, it did work, and quickly…
called valves, but actually glass tubes air taken out; near vacuum didn’t work until “warmed up” needed a lot of energy to work took up lots of space But once working, it did work, and quickly… Head of IBM (1950s) said that the world would only need four of these computers anyway (!)
8
More from Shannon (1948) Demonstrated the essential unity of all information media: text telephone signals radio waves pictures, film, etc… ALL could be encoded in the universal language of binary digits used term “bit” for a binary digit
9
Binary Logic and CPU Design
Putting theory into practice… Data stored as blocks of ‘cells’ (effectively switches) voltage off/on in binary either “0” or “1” If memory and data binary… processing must be binary as well! 9
10
Number Systems (binary and others)
Number of different symbols… “base” of number system many tried over the years Examples: base 2: binary (2 symbols) base 10: decimal (10 symbols) base 12: (inches in a foot, etc. flawed… only 10 symbols) base 16: hexadecimal (16, and 16 symbols) Nystrom (1859!)
11
Logic and Digital Logic
“Logical”… through mental activity (human CPU?) (Mr Spock) “Emotional”… following gut feeling Now add “digital” specific type of logic required to program a CPU!
12
Some Definitions… binary digit bit 0 or 1 byte: a group of 8 bits
(nibble: a group of 4 bits) “word”: a group of bits of a fixed length actual length of a word depends on the register size in a CPU 12
13
Number Theory: what does decimal 2314 mean?
Thousands Hundreds Tens units 10x10x10 10x10 10 103 102 101 100 bracket form: (2 x 103) + (3 x 102) + (1 x 101) + (4 x100 ) most significant digit 2 least significant digit 4 13
14
Counting in Binary… Same logic as decimal (denary) system Two symbols
When both symbols used start another column…
15
Counting in Hexadecimal
16 symbols 0-9 plus A-F Same logic as decimal or binary Why bother? represents a nibble as a single symbol!
16
What does binary 1101 mean? 1 1 0 1 2x2x2 2x2 2 1 23 22 21 20
2x2x2 2x bracket form – for conversion... (1 x 23) + (1 x 22) + (0 x 21) + (1 x20 ) = 13 in denary (decimal) 16
17
Binary representation of the 8 bits: 1011 0101
= 181 Q. How many different binary numbers can an 8 bit word hold? A (= 28) ranging from to 17
18
“Significance” of a bit
All bits aren’t equal! As with decimal, the greater the value… the more significant it becomes e.g. decimal 13821 1 in 10000s column… has much greater value than 1 in the 1s column
19
What about a 16 bit number (a) To what decimal number is it equal? (b) What is the value of the most significant bit? (c) How many different 16 bit binary numbers can be represented? 19
20
The 16 bit number (a) To what decimal number is it equal? Answer: = 53 (b) What is the value of the most significant bit? Answer: 0 (c) How many different 16 bit binary numbers can be represented? Answer: 216 = (which is 64 k) 20
21
Shorthand Rows of many 1s and 0s can be very confusing
easy to make mistakes Solution: divide into blocks of 4 digits (nibbles) use hexadecimal equivalent for each nibble very useful in hard disk analysis, when searching for data 21
22
Hexadecimal notation Decimal Binary Hexadecimal 0 0000 0 1 0001 1
22
23
Hexadecimal notation Decimal Binary Hexadecimal 10 1010 A 11 1011 B
F 23
24
Notation Useful to know what type of number we are dealing with e.g. “110” use subscript at the end 11010 = 110 (denary) 1102 = 110 (binary) = 6 (denary) 110H or = 110 (hexadecimal) = 272 (denary) So now you know! 24
25
Binary Logic & CPU Binary logic + Boolean algebra
logic gates mathematically predictable effects of combining them documented as truth tables Problem: valves wired together produce very large, energy hungry logic gates: CPU large, use a lot of energy!
26
Transistors Same effect as valves Wonderful discovery much smaller
use much less energy Wonderful discovery very exciting for Shannon? computers could be much smaller than he expected…
27
Effects of Miniaturisation
Transistors first used in radios very popular with 1950s “teenagers” Took some time to become part of more sophisticated devices breakthrough: integrated circuits (ICs) many transistors on a single component first IC with enough transistors to be a CPU with programmed instructions… Intel (1972)
28
Now, let’s make a Computer
… or at least the CPU (millions of transistors) Ultra Sparc 1 Pentium 4 Opteron 21364 Itanium 2 McKinley
30
Computer Program (Code)
CPU with INPUT & OUTPUT Computer Program (Code) 1 do this… 2 do that 3 now this 4 goto 1 CPU Memory VDU Plus Data… Keyboard
31
So THAT’S how they work!? Next week: Structure of a CPU and programming it!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.