Fichas
Week1
Fichas del conjunto (43)
- 1Computer hardwareA processor contains around 10^7
(ten million) electronic components - 2System softwareA modern operating system contains ~107
lines of code (C and C++) - 3Levels of abstractionApplications
Algorithms, Program. Languages
System Software (OS, compilers)
ISA (HW-SW interface)
Microarchitecture
Digital Circuits
Electrons - 4SoftwareApplications
Algorithms, Program. Languages
System Software (OS, compilers) - 5HardwareMicroarchitecture
Digital Circuits
Electrons - 6Computer ArchitectureISA (HW-SW interface)
Microarchitecture
Digital Circuits - 7Types of computer systemsServers
Personal computers
Mobile devices
Embedded devices - 8Embedded devices– Task-specific: sensing, control, media playback, etc
– Low-cost, low-power
– Single program - 9Mobile devices– Smartphones, tablets
– Highly integrated (multiple processors, GPU, GPS,
media accelerators, etc), low-power
– Single-user, multi-program - 10Personal computers– Laptops, desktops
– Balance cost and processing power
– Few users, multi-program - 11Servers– Used for either a few large tasks (e.g. engineering apps),
or many small tasks (e.g. web server, Google)
– Fast processors, lots of memory
– Multi-user, multi-program - 12Compilersoftware that translates a high-level program into assembly (machine) language
- 13Operating Systemsoftware that provides lots of facilities needed by applications, which are too complicated to provide directly in the hardware
– Files, Protection, Processes, Threads, Virtual memory, Communication, Etc - 14Instruction Set Architecture (ISA)• Defines the machine language (executed directly by the computer hardware)
– Commercial examples: RISC-V, MIPS, arm, Intel x86, etc
– In this course: Sigma16
• The interface between low-level circuits and high-level software
• Simple enough that it's possible to design a digital circuit that executes machine language
• Powerful enough that high-level languages can be translated into it - 15Digital circuitsThis subject consists of
– The basic “building block” components
– The way they behave when connected together
– How to combine components in order to make a circuit that does something useful
• Surprisingly
– There are only a few types of components
– They are very simple
– Yet when connected the right way, they give extraordinary behaviour - 16Analogue representationThe physical measure is an “analogy” or “analogue” to the measures in your
problem
An electronic analogue computer solving a differential equation (say, the heat equation) would make the voltage in the computer proportional to the heat in the object - 17Advantages AnalogueCan be extremely fast
- 18Disadvantages Analogue– Limited precision
– After lots of calculations, errors will accumulate
– It's hard to represent data other than real numbers (e.g. strings)
– Large numbers can be impossible - 19Digital• Count on your fingers
• This is digital computing
• The word digit means finger - 20Advantages of digital representation• You can get as much precision as you want
• Errors don't accumulate after lots of calculations
• All datatypes can be represented
• Large numbers just require also more digits - 21Binary Digits: Bits• Voltage is used to represent information in digital circuits
• We call one of the standard voltages 0 and the other 1
• This basic unit of information is a Binary Digit or Bit
• Disadvantage: little information per bit, so must use many bits - 22Digital computing with bits• Use just two voltages, it doesn't matter what they are, for example
– TTL circuits: 0 volts and 5 volts
– CMOS circuits: -2.5 volts and 2.5 volts
• Circuits are simpler and more reliable if we just use two different voltages - 23Flip FlopA flip flop is a basic digital circuit that can
– Take a data bit and store it (“remember it”)
– Remember the value indefinitely
– Read out the stored value
• The computer memory consists of a large number of these basic circuits - 24Bytes• A byte is a string of 8 bits
• A byte is represented in the computer by 8 copies of the basic bit storage
circuit (flip flop) - 25Information capacity of a byte• There are exactly 2^8 = 256 distinct values that can be represented in a byte
• There are many different ways to utilise the information capacity of a byte
• Each basic datatype (integer, character, etc) needs a representation method - 26WordsA word is similar to a byte, but a larger amount of information
Short word 16 bits 2 bytes
Word 32 bits 4 bytes
Long word 64 bits 8 bytes - 27architecture• The term “64-bit architecture” means that the internal hardware uses
(mostly) 64-bit words
• Generally, a larger word size yields faster performance - 28Information capacity of a word• A word containing k bits is called a k-bit word, and can represent 2k distinct
values - 29Non-negative integersbinary
- 30Signed integerstwo's complement
- 31Approximate real numbersfloating point
- 32What do computer hardware and programming languages allow in data representationComputer hardware and programming languages support other representations
- 33Binary numbersBinary representation uses a word of k bits to represent a non-negative
integer between 0 and 2^k- 1
Binary numbers cannot be negative - 34Binary number representationColumn values are powers of 2
2^0 = 1 weight of rightmost bit
2^1 = 2
2^2 = 4
...
2^k weight of leftmost bit - 35Converting decimal to binaryWhen we convert a decimal number x to binary, we need to
– Know the word size k of the result
– Check that x will fit in the word: 0 ≤ x ≤ 2^k- 1 - 36Binary additionYou can add two binary numbers x and y the same way as adding decimal
numbers
Work through each column, from right to left
In each column, add the bit from x, the bit from y, and the carry from the
column to the right
This gives the sum bit s for the column, and the carry output which goes to
the left - 37Adding bitsx+y+z c s
0+0+0 0 0
1+0+0 0 1
1+1+0 1 0
1+1+1 1 1 - 38Two's complementTwo's complement is a method for representing integers that can be negative
or positive
Remember that a k-bit word can represent 2^k different values
In two's complement, half of those values represent negative integers,
and half represent nonnegative integers
The range is -2^(k-1) to 2^(k-1)- 1 - 39Sign bitThe sign bit is the lefmost bit of a two's complement number
– If the sign bit is 1, the number is negative (< 0)
– If the sign bit is 0, the number is nonnegative (≥ 0)
– If all the bits are 0, the number is 0 - 40Negating a two's complement number xIf the sign bit is 0, then treat it just like a binary number
If the sign bit is 1, then negate it and treat the result like a binary number
Two steps
1. Invert each bit (replace 0 by 1, replace 1 by 0)
2. Add 1
The result is the representation of –x
It works for every number (negative, zero, positive) - 41Why Hexadecimal is usedWhen working with machine language and assembly language, we frequently need to write down the values of words
You can break a long word of bits into groups of 4 bits, and replace each
group by the corresponding hex digit - 42Arithmetic with hexTo add two hex numbers, write them one above the other, and add by columns
If the sum in a column is greater than 16, you add a carry of 1 to the column to
the left - 43Pronounce and righting hexProfessionals pronounce hex numbers by saying every digit, including leading zeros, and never use tens, twenty, hundreds, etc for hex
– 23 is decimal: 2 x 101 + 3 x 100
, pronounced “twenty three”
– $0023 is hex: 2 x 161 + 3 x 160 = 35, pronounced “zero zero two three”
Información
- Descripción
- Computer Science Fichas sobre Week1, creado por Isaac Gilbert el 11/01/2022.
- Creado por
- Isaac Gilbert
- Visitas
- 1
- Valoración