First, the "Introduction to Computer Science"
Chapter IV - gate and circuit
(A) Electrical and Computer
First, there must be an electrical circuit ( Circuit ), is a gate circuit ( Gate ) composed implement the specified logical functions, you can perform more complex tasks. Door apparatus to perform basic operations on the electrical signal, or receiving a plurality of inputs, generating an output. Notation described and three circuits: boolean ( Boolean algebra ) expression, a logical block diagram ( Logic Diagram ), the truth table ( Truth Table )
(B) the door
Six kinds of doors:
AND gate ( and ) the whole truth to be true A * B
NAND ( Not ) reversed authenticity A '
OR gate ( or ,) before the whole false false A + B
Exclusive OR gate ( XOR ) is true different A ring plus B
NAND gate ( NAND ) and Not + (A * B) '
NOR gate ( NOR ) or Not + (A + B) '
(C) of the door structure
It is used to control the current gate. Transistors ( Transistor ) is used to achieve this function of the underlying hardware, the transistor material, a semiconductor ( Semiconductor ). A transistor; as a wire or a resistor, which is determined by a specific input level.
Input and output transistors: a NAND gate itself, a ground, 0 ungrounded
NAND gate: in series, both inputs are 1 , was ground output 0 and the door: There is a 0 , is 0
NOR gate: in parallel with an input 1 is grounded, a source electrode was short-circuited, the output of 0 or door: There is a 1 , that 1
(D) Circuit
Circuit may be divided into two categories, one category is combining circuit ( Combination Circuit ) (the output is determined only by the input value) is another timing circuit ( Sequential Circuit ) circuit output is a function of the current state of the circuit and the input value.
Combining circuit: the output of a gate as the other input gate circuits can be combined into a door.
Equivalence - in line with the distribution ratio
Morgan's law (AB) '= A' + B '(A + B)' = A'B '
Adders ( Adder ): adding circuit for performing binary.
Half adder ( Half Adder ): two-digit calculating circuit and the right and generates a carry. Our calculation is the actual output of two. Only calculates half adder input bits are binary
Full adder ( Full Adder ): calculated two-digit and, taking into account the carry input of the circuit.
Multiplexer :( Multiplexer ) is a general circuit generating a single output signal, the output value is equal to one of a plurality of values of the input circuit. The multiplexer input select signal or signals as selection control lines select which input signal as an output signal.
Demultiplexer: perform the inverse operation of the multiplexer.
The storage circuit ( the SR latch)
IC ( Integrated Circuit ) (Chip Chip ): a plurality of gate embedded in silicon.
CPU is a high-level circuit having an input line and an output line.
Chapter V - calculation means
Von Neumann architecture: means for processing information independent of the means for storing information
The concept (a) storing programs
Five components: a memory unit, an arithmetic logic unit, an input unit, an output unit, a control unit
Memory addressability: in each addressable memory location to store the number of bits of the address.
An arithmetic logic unit: the ALU performs the basic arithmetic and logic operations
ALU a small number of special storage units: a register for storing intermediate values or special data
The input unit: INPUT Unit output unit output unit
Control unit: in charge of "Reading execution" cycle, is the organizational strength in the computer.
Instruction register ( the IR ) holds the current instruction register. ,
Program counter ( the PC register address of the next instruction) to be executed is stored.
A central processing unit ( the CPU combinations of arithmetic logic unit and a control unit:)
Bus: carry three kinds of information, address, data and control information.
Bus width ( Bus width ) parallel bits transmitted on the bus
Cache ( Cache Memory ) storing frequently used data in a small high-speed memory
Pipeline ( PIPELINING ) A command into smaller steps may be performed in the overlap technique
Motherboard ( Motherboard ) main wire board
Read - execution cycle
RAM / ROM
Secondary storage devices: disk drive, the track ( Track ) sector ( a SECTOR ) Block ( Block ) seek ( Seek Time ) latency ( Latency ) access time ( Access Time ): seek time + latency, the transmission rate ( Transfer Rate )
(B) Embedded Systems
Embedded Systems: The concept is vague, contains in addition to a desktop PC all things. The tendency is equivalent to the system hardware.
(C) parallel structure
The general form of parallel computing: Bite level, instruction level, the data level, task level
Sync ( Synchronous Processing ): The multi-processor applied to the plurality of data sets with a program.
Shared Memory Parallel Processor ( Shared Memory Parallel Processor ): a plurality of processors share memory where the entire
Digital Divide
Second, the "self-study is a craft."
Chapter V strings
- Character, the code conversion table the ord (), CHR ()
- Converting between strings and numerical STR () a float () int () INPUT ()
- Escape: \ "also called a caret"
- String operators: + and function the same space, so that the two strings can be spliced together, * the like repetition, I judge true or false, returns a Boolean value
- String index string is an ordered container. Indexing operator []
- Built-in functions for manipulating strings the ord , INPUT , int , a float , len , Print
- For string processing method invocation str needs . This symbol.
- Case Processing: Str.upper () str.lower () str.swapcase () str.casefold () str.capitalize () str.title ()
- Search and replace str .count () str.find. () Str.rfind () str.index ()
Str.startswith() str.endswith()str.replace()str.expandtabs()
- Removal of the child character str.strip () str.lstrip () str.rstrip ()
- Split string STR .partition () str.splitlines () str.split ()
- String concatenation str.join ()
- String layout str.center () str.ljust () str.rjust ()
- Format string str.foramt ()
- String attribute str.isalnum () str.isalpha () str.isdecimal () str.isdelight () str.isnumeric ()
Chapter VI data container
1, iteration ( the iterate ) data elements of the container can be iterative. The container elements can be accessed individually, there is an operator in Range ()
2, the list of list ordered type of container, the generated list mode a_list = [] b _ list = [1,2,3] a_list.append ()
Magical method list comprehension
3, a list of operators splice + copy: *; logic operation: in, Not in, comparison operators
4, according to the index to extract a list of elements
5, a list of available built-in functions .len .max .min
6, Method, , tuples, sets, dictionaries did not look carefully. .
Chapter VII file
1, create a file built-in function Open ()
2, delete the file calls the os module
3, read and write files f.write () reached, f.read () f.readline ()
4, With statement block
ISSUES
- How to make python does not automatically shut down after running interface
- ord What shorthand?
- \ n specification writing a new line