当前位置:网站首页>Arm bare metal

Arm bare metal

2022-07-08 01:14:00 __ Small crisp__

ARM System development basis

Circuit Foundation

Correspondence between software and hardware

Software : 0 1
circuit : Low level High level
chip : end Conduction

diode

1)  Unidirectional conduction characteristics   ---  rectification 
2)   Reverse breakdown characteristics  ---  Regulator tube 
3)   Luminescent properties      --- LED
4)   Capacitance characteristics      ---  Energy storage  RAM

RAM

1) SRAM ---  Hardware solution   ---  There are three buses 、 fast 、 your 
2) DRAM ---  Software solution   ---  There are no three buses ( It must be initialized before using )、 cheap 、 slow 

triode — switch

1) distinguish NPN and PNP Look at the arrow P—>N
2) Control logic
PNP
Conduction : Apply low voltage to the base
end : Apply high voltage to the base
NPN
Conduction : Apply high voltage to the base
end : Apply low voltage to the base

MOS tube — switch

1)  distinguish N Channel and P Channel viewing arrow  P--->N   Taking the first letter 
2)  Control logic 
           P type     
       Conduction : Apply a low voltage to the grid 
       end : Apply a high voltage to the grid 
           N type    
       Conduction : Apply a high voltage to the grid 
       end : Apply a low voltage to the grid 

Add : Diode triode and MOS Tube difference
Electron tube
These three kinds of tubes are semiconductor devices .
1. As the name suggests, diode has two poles , only one PN junction , Yes, it will PN The junction, together with the corresponding electrode lead and tube shell, becomes a semiconductor diode . Suitable for high-frequency and low-power work , It is also used as a switching element in digital circuits , The diode has the characteristic of unidirectional conduction , Generally used in rectification 、 Steady pressure 、 Follow up and other fields .
2. Triode is called transistor for short ,( Contains a collector c, The emitter e, The base b) It's not just two PN Knot together , The thickness of each pole is exquisite . The triode is divided into NPN The type and PNP Type two , It is the most important semiconductor device . It can magnify 、 Oscillation or switching .
3.MOS Tubes are also called field effect tubes , It is a relatively new type of semiconductor device . The shape is similar to that of ordinary transistors , But their control characteristics are quite different .
General energy transistor is a current control element , By controlling the base current, the collector current or emitter current can be controlled , A certain current must be supplied to the signal source to work .
MOS The tube is a voltage control element , Its output current depends on the input voltage , Basically, there is no need for the signal source to provide current , So its input resistance is very high , This is its outstanding feature . It is widely used in amplifying circuits and digital circuits .

Digital gate circuit

(1) And gate – Breaking characteristics – meet 0 by 0
(2) Or gate – Short circuit characteristics – meet 1 by 1
(3) Not gate – Take the opposite
1. Exclusive or : If a、b The two values are different , The XOR results in 1. If a、b The two values are the same , The exclusive or result is 0.
2. And or not
1)“ And ” Operation and “ And ” door ( Yes 0 have to 0, no 0 have to 1)
2)“ or ” Operation and “ or ” door Of all the conditions that determine a conclusion , As long as there is one established , Then the conclusion is established , This causal relationship is called or logic
3)“ Not ” Operation and “ Not ” door If the precondition is “ really ”, The conclusion is that “ false ”; If the precondition is “ false ”, The conclusion is that “ really ”. That is, the conclusion is the negation of the premise , This causal relationship is called illogical

Byte order :
1)ARM The architecture regards memory as a slave 0 Linear combination of bytes at the beginning of the address . from 0 Bytes to 3 Byte places the first stored word (32 position ) data , From 4 Byte to byte 7 Bytes to place the second stored word data , Arrange in sequence .
ARM The processor is 32 Bit processor , Its maximum addressing space is 4G, Align in words .
Word alignment : For example, you have a 32 Bit integers , When storing , It can be stored in 0 The location of ,4 The location of ,8 The location of , But it cannot be stored in 3 This byte position , Byte alignment is not satisfied .
2)ARM The architecture can store word data in two ways , Call it big end format and small end format .
We use ARM cortex-A9 Small end format storage is used .
The storage format of the big end is different from that of the small end :
Big end format : The high bytes of word data are stored in the low address , The low byte of word data is stored in the high address .
Small end format : Contrary to the big end storage format , In the small end storage format , The low address stores the low byte of word data , The high address stores the high byte of word data .
The small end : Low to low , High to high
Big end : High to low , Low to high

The ARM  It can be used  little/big endian Format storage data 

 Insert picture description here
Little endian:
The least significant byte is stored in the low address space of memory
Big endian:
The most significant byte is stored in the low address space of memory


Computer hardware composition :

1. input device
2. Output devices
3. Memory
4. Arithmetic unit
5. controller
6. Computer bus structure

Memory :

 Memory is a component used to store programs and data , It's a memory device , It's also that computers can realize “ Stored program control ” The basis of .

 Insert picture description here
1). Cache memory (Cache)
CPU You can directly access , It is used to store the active part of the currently executing program , In order to quickly report to CPU Provide instructions and data .
( What is cache ( First level cache ))
2). Main memory
May by CPU Direct access , It is used to store the programs and data currently being executed .
(CPU Main memory can be accessed )
3). Secondary storage
Set outside the host ,CPU No direct access , It is used to store programs and data that are not involved in the operation for the time being , Transfer to main memory when needed .
 Insert picture description here
Storage speed :reg->cache->main memory->disk cache

Arithmetic unit

It is a component that processes and calculates information , The usual operations are arithmetic operations and logical operations , Therefore, the core of the arithmetic unit is the arithmetic logic operation unit ALU, There are several registers in the arithmetic unit ( Such as accumulation register 、 Registers, etc )
 Insert picture description here

controller

It's the command center of the whole computer . The controller mainly includes timing control signal forming unit and some special registers .

The bus structure of a computer

The major basic components , Connected in some way to form a computer hardware system .
At present, many computers ( Mainly refers to small 、 Microcomputer ) Bus is used between the major basic components of (Bus) Connected .
A bus is a group of common information transmission lines that can serve multiple components , It can send and receive the information of each component in time-sharing .
Single bus
 Insert picture description here

Multibus
 Insert picture description here


ARM Working state

1).ARM state , At this point, the processor executes 32 Bit word aligned ARM Instructions .
2).Thumb state , At this point, the processor executes 16 Bit word aligned Thumb Instructions .
3).Jazelle state 
 After an exception occurs , The processor will work in ARM state 

When ARM Processor execution 32 Bit ARM Instruction set time , Working in ARM state .
When ARM Processor execution 16 Bit Thumb Instruction set time , Working in Thumb state .
During program execution , The processor can switch between two working states , also cpu The working state does not affect cpu The operating mode of and the contents of the corresponding registers

Harvard structure and von Neumann structure

  • feng · Neumann structure

feng · Neumann architecture is also called Princeton architecture .
feng · Neumann's main contribution is to propose and realize “ Storage program ” The concept and binary principle of , later , The electronic computer system designed by using this concept and principle is collectively referred to as “ feng · Neumann type structure ” Computer . feng · Neumann processors use the same memory , Transmission via the same bus .
Because both instructions and data are binary code , The addresses of instructions and operands are closely related , therefore , It was natural to choose this structure at the beginning . however , This kind of instruction and data share the same bus structure , It makes the transmission of information flow become the bottleneck of computer performance , It affects the improvement of data processing speed .

It takes... To complete an instruction 3 A step , namely : Take command 、 Instruction decoding and execution .
To Feng · Neumann architecture processor , Since fetching instructions and accessing data need to be accessed from the same storage space , Transmission via the same bus , Therefore, they cannot overlap , After only one is finished, proceed to the next .

  • Harvard structure

    Harvard structure is a memory structure that separates program instruction storage from data storage , Pictured 1 Shown .
     Insert picture description here
    Microprocessors with Harvard architecture usually have high execution efficiency . Its program instructions and data instructions are organized and stored separately , When executing, the next instruction can be read in advance .
    Harvard architecture refers to the independent architecture of program and data space , The purpose is to reduce the memory access bottleneck when the program is running .
    For example, in the most common convolution operation , An instruction takes two operands at the same time , In pipeline processing , There is also a finger fetching operation , If programs and data are accessed through a bus , There must be a conflict between finger fetching and data fetching , This is very unfavorable to the execution efficiency of loops with large amount of computation .
    Harvard structure can basically solve the problem of conflict between fetching index and fetching data .

  • feng · The difference between Neumann system and Harvard bus system
    The difference between the two is whether the program space and data space are integrated . feng · Neumann structure data space and address space are not separated , Harvard structured data space and address space are separate .
    Most of the early microprocessors used Feng · Neumann structure , Typical representatives are Intel The company's X86 Microprocessor .
    The application of Harvard bus technology is based on DSP and ARM As a representative of the .

原网站

版权声明
本文为[__ Small crisp__]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130546543455.html