ari logic magedhi ndiwo hwaro hwemagetsi edhijitari. Nokuda kwechikonzero ichi, anokosha zvikuru, uye kana uchida kutanga kushanda nawo, unofanira kuziva zvaari, kuti anoumbwa sei, uye basa rawo. Saka iwe unogona kushandisa akateedzana machipisi aripo pamusika ane rudzi urwu rwemikova kuti utange kugadzira yako mapurojekiti uchishanda neiyi pfungwa.

Aya magonhi, akasanganiswa nemamwe Zvemagetsi zvigadzirwa, uye kunyange nemahwendefa akafanana Arduino, vanogona kupa mitambo yakawanda kuvagadziri sezvaunozviona iwe pachako.

## Chii chinonzi logic magedhi?

ari zvine musoro masuo iwo akakosha zvinhu zvedhijitari logic yekuitwa kwemadhijitari emagetsi maseketi. Aya magedhi anopa yakaderera (0) kana yakakwirira (1) masaini emagetsi pakubuda kwawo zvichienderana nemamiriro ezvaanopinda. Ivo kazhinji vane imwe yekubuda uye maviri masuo, asi panogona kunge paine magonhi ane anopfuura maviri ekupinda. Uye zvakare, pane zvakasarudzika senge inverting gedhi kana NOT, ine chete yekupinda uye imwe inobuda.

Kutenda kune aya maBoolean ekuisa uye zvinobuda zvaunogona kuwana yekutanga binary logic mashandiro, sekuwedzera, kuwanda, kuramba, nezvimwe.

### Zvinoitwa sei?

Logic magedhi haagone kungoitwa nenzira imwe chete. Kutaura zvazviri, ndicho chikonzero kune zvakasiyana mhuri dzine musoro. Imwe neimwe yeidzi mhuri ichaisa gedhi nenzira imwe, uchishandisa akasiyana emagetsi zvikamu.

kubudikidza ejemploKana TTL ichishandiswa chip, magedhi achagadzirwa nebipolar transistors, nepo CMOS logic inongobva paMOSFET transistors. Pamusoro pemhuri mbiri idzi, dzinowanzozivikanwa zvakanyanya, kunewo mamwe akadai seBiCMOS (inobatanidza bipolar neCMOS transistors), RTL (resistors uye bipolar transistors), DTL (diodes uye transistors), ECL, IIL, nezvimwe.

Iko hakuna mhuri imwe iri nani kupfuura imwe, zvinoenderana nekushandiswa. Asi zvakadaro, CMOS Ndiyo imwe yeanonyanya kushandiswa mumaseketi epamberi, akadai seCPU, MCU, GPU, ndangariro, nezvimwe. Kune mamwe masekete akareruka zvakajairika kuwana iyo TTL.

### Applications

Mashandisirwo emagedhi aya ane logic haaperi. Nezvidhinha izvi zvakakosha iwe unogona kuvaka akawanda edhijitari maseketi. Kubva kune akareruka adder, kune yakaoma CPU, kuburikidza nemamwe akawanda maseketi aungafungidzira. Muchokwadi, mazhinji masisitimu aunoshandisa mazuva ese, akadai sePC yako, TV yako, nharembozha, nezvimwe, ane mabhiriyoni emasuwo ekufunga.

Kuti ukwanise kugadzira maseketi aya zvinodikanwa kuve neruzivo rwedhijitari logic, Boolean algebra, ruzivo rwakanaka rweiyo binary system, kurerutsa mabasa, nezvimwe. Zvese izvi zvaizopa kune akati wandei zvinyorwa, asi zvingave zvinonakidza ...

Un muenzaniso unoshanda yekushandiswa kwemagedhi ane logic ingave iri nyore adder yaunogona kuona mumufananidzo uri pamusoro. Iro dunhu rakareruka, iro rinokwanisa kuwedzera mabheti maviri (A uye B) mune zvaro zvekuisa kuti ripe iyo Sum mhedzisiro, uye zvakare Takura, ndiko kuti, zvaunobvisa ... Unogona kuona mibairo ipa mutafura inotevera:

A B Sum takura Binary result
0 0 0 0 00
0 1 1 0 01
1 0 1 0 01
1 1 0 1 10

Ukatarisa patafura iyi, ukawedzera 0 + 0 mubhinari inokupa 0, ukawedzera 1 + 0 ari 1, asi ukawedzera 1 + 1 inopa 2, iyo mubinary system inofanana negumi.

## Mhando dzemagedhi ane logic

Kana ari mhando dzemagedhi emufungoIwe une nhamba yakanaka yavo, kunyangwe anonyanya kushandiswa ari anotevera (nematafura avo echokwadi):

Sezvauri kuona mumufananidzo uri pamusoro, kune akati wandei mazita ekumiririra logic magedhi mumaseketi. Iyo yakanyanya kupararira ndeye ANSI (mutsara wechipiri), kunyangwe zvakanaka kuziva zvakaenzana kuti ugone kududzira mamwe maseketi nemamwe mafomati (DIN kana chiGerman, BS kana Briteni, IEC, NEMA, ...).
• Buffer (Hongu): inozivikanwa sebhafa kana gedhi rakananga, sezvo kubuda kwayo kuchave nemamiriro akafanana nekuisa kwayo. Kunyangwe zvingaite sezvisina basa, mumasekete mazhinji epfungwa inowanzo shandiswa seazvino amplifier kana sevateveri vemagetsi.
Kupinda Buda
0 0
1 1
• Kwete (inverter): ndiko kurambira zvine musoro (¬ o '), kureva kuti, inopinza chidimbu pakubuda kwayo.
Kupinda Buda
0 1
1 0
• UYE (Y): iri rimwe gedhi rinoita basa rechigadzirwa (·) remabhinari mabhiti ekuisa kwaro. Zvichireva kuti, zvingaita sekuwanza A na B. Naizvozvo, chinhu chipi nechipi ne zero i zero, chinongopa chimwechete kune chabuda kana zvose zviri zviviri 1. Nokudaro zita racho 1 NE 1.
A B S
0 0 0
0 1 0
1 0 0
1 1 1
• GOLD): iri rimwe gedhi rinoita zvine musoro kuwedzera oparesheni (+). Kureva kuti, chimwe chezvazvinoburitsa OR chimwe chacho, KANA zvose zvinofanira kuva pa1 kuti goho rive 1. Kana ari maviri ari 0, kubudawo ndi0 zvakare.
A B S
0 0 0
0 1 1
1 0 1
1 1 1
• XOR (kana yakasarudzika): Izvi zvakasarudzika OR inoita basa reBoolean A'B + AB ', uye chiratidzo chayo ndeichi

. Muchiitiko ichi, kana mairi maviri akaenzana akaenzana, kubuda ndeku 0. Kana akasiyana, ichava 1.
A B S
0 0 0
0 1 1
1 0 1
1 1 0
• NAND (yakaramba): ndicho chakarambwa chine musoro chigadzirwa, kureva, inverse ye AND. Zvakafanana nekushandisa NOT pane UYE kuburitsa kushandura mabheti ekubuda. Naizvozvo, mhedzisiro ndeiyi:
A B S
0 0 1
0 1 1
1 0 1
1 1 0
• NOR (Kana kurambwa): iyo mari inonzwisisika yakarambwa, kana kuti chii chakafanana, OR ine gakava rabuda, zvichikonzera kupesana kweOR.
A B S
0 0 1
0 1 0
1 0 0
1 1 0
• XNOR (chaiyo NOR): zvakangofanana nekuisa iyo bhinari mubatsiri kune XOR gedhi. Kureva, ita iyo AB + A'B 'operation. A akapetwa B akawedzera kuna A nguva B akaramba. Naizvozvo, zvinobuda zvichafanana neizvo zveiyo inverted XOR:
A B S
0 0 1
0 1 0
1 0 0
1 1 1

Ose NOR neNAND maviri emasuwo anonyanya kufadza, sezvo achizivikanwa se universal logic magedhi. Ndokunge, iwe unogona kugadzira maseketi chete navo kuti vamiririre chero imwe mhando ye logic gedhi. Izvi zvakakosha, nekuti kana ukatenga machipisi nemagonhi aya, unogona kuve nemabasa ese. Semuyenzaniso, kana iwo maviri mapindiro eNOR akavharwa kana kuti NAND yakaenzana neNO. Iwe une zvimwe zvakaenzana pano:

Mabasa: electronics-tutorials.ws

Te Ini kurairaKuti udzidze zvakawanda, Google dunhu riri nyore rine chero magedhi. Uye kuti uzive zvazvinoita, ita rudzi rwe "reverse engineering", tevera mitsetse yezvipo uye zvinobuda uye ona mamiriro emutsara wega wega zvinoenderana nezvinopihwa kune zvakabuda.

kubudikidza ejemploKana iwe ukatarisa pamufananidzo uri pamusoro, dhayagiramu yakaenzana yeOR ine NAND magedhi, uchaona kuti ine maviri eNAND magedhi ane bhiriji rekubuda kwavo uye zvese zvinobuda zvinoenda kune imwe NAND. Ramba uchifunga zvinotevera:

• Ukaenda kutafura yechokwadi yeNAND, uchaona kuti kana mairi maviri ekupinda ari 0 inobuda iri 1, uye kana mapindiro ayo maviri ari 1 inobuda iri 0.
• Sezvo vari bhiriji, kana mapindiro ari 1 (mumwe anopinda ese ari maviri), mhedzisiro yacho 0. Uye kana iyo yekuisa iri 0 (ose zero), inobuda ichava 1, inofanana ne NOT.
• Naizvozvo, tine maNOT maviri ezvimedu A neB. Pakubuda kwavo saka tichava neA 'naB'.
• Izvo zvirambidzo zviviri zvinopinda muNAND yekupedzisira, iyo ichaita inverse inonzwisisika chigadzirwa cheaya mabhiti maviri.
• Zvinoenderana nemirairo yepfungwa, izvi zvakaenzana nehuwandu hwakananga, kureva, A + B. Naizvozvo, mhedzisiro ichaita sekunge yaive OR ...

## Logic Gate Chip Series - Kwaunotenga

Muzvitoro zvemagetsi munogona tenga machipisi akachipa ine logic magedhi ekutanga kushandisa mumapurojekiti ako. Aya machipisi haazi gedhi rimwe chete relogic, asi anobvumidza iwe kuti uve akati wandei kuitira kuti iwe ugone kubatanidza mapoinzi avo uye zvinobuda sezvaunoda. Semuenzaniso, mudhayagiramu iri pamufananidzo uri pamusoro unogona kuona yakajairika pinout yeDIP chip ine 4 NAND magedhi. Mukuwedzera, ine zvakare mapini maviri esimba (Vcc uye GND).

Heano mamwe kutenga mazano:

### Zvimwe zviwanikwa

Kuti udzidze zvakawanda nezve mashandisiro emagedhi aya uye kuti ungatanga sei kugadzira maseketi nawo, unogona kushandisa aya Imwe zviwanikwa chii chandinokurudzira:

### Digital logic neArduino

Zvimwe zviwanikwa chii chaunacho mumaoko ako kana uchitova nacho ndiro Arduino UNO mumaoko ako ari shandisa Arduino IDE kugadzira zvikeche iyo inotevedzera aya mabasa epfungwa kuti, semuenzaniso, ona mhedzisiro nenzira inooneka ine LED inotevedzera kubuda kwegonhi. Semuenzaniso, kuisa LED papini 7 uye kushandisa 8 uye 9 semapupu A uye B:

```int pinOut = 7;
int pinA = 8;
int pinB = 9;

void setup()
{
pinMode(pinOut, OUTPUT);
pinMode(pinA, INPUT);
pinMode(pinB, INPUT);
}
void loop()
{
boolean pinOutState;
//AND
pinOutState =pinAState &amp;amp; pinBState;
digitalWrite(pinOut, pinOutState);
}
```

Pano a AND (&) basa rakashandiswa, sezvauri kuona, asi unogona kutsiva iyo mutsara wekodhi pasi pe // UYE mutsara nevamwe kushandisa. mamwe mabasa epfungwa:

```//OR
pinOutState = pinAState | pinBState;

//NOT
pinOutState = !pinAState;

//XOR
pinOutState = pinAState ^ pinBState;

//NAND
pinOutState = !(pinAState &amp; pinBState);

//NOR
pinOutState = !(pinAState | pinBState);

//XNOR
pinOutState = !(pinAState ^ pinBState);

```

Iva wekutanga kutaura