Computers, Programming
Binary code. Hom thiab ntev ntawm lub binary code. Rov qab binary code
Binary code yog ib daim ntawv uas teev cov xov xwm nyob rau hauv daim ntawv ntawm cov laug thiab zeros. Xws li ib tug system rau xam ib positional puag 2. Rau hnub tim, lub binary code (rooj hais me ntsis hauv qab no muaj ib co piv txwv ntawm cov ntaubntawv povthawj siv rau cov xov tooj) siv nyob rau hauv tag nrho cov digital pab kiag li lawm. Nws tej chaw yog vim lub siab muaj kev cia siab thiab simplicity ntawm no nkag daim ntawv. Binary xam yog heev yooj yim, ntsig txog, thiab nws yog ib qho yooj yim los mus siv nyob rau hauv kev kho vajtse. Cov hluav taws xob Cheebtsam (los yog raws li lawv yog hu ua - logic) yog heev txhim khu kev qha raws li lawv khiav lag luam nyob rau hauv tsuas yog ob tug hais tias: ib zajlus kom chav tsev (piv txwv li lub tam sim no), thiab ib tug logic pes tsawg (tsis muaj tam sim no). Yog li, lawv sib piv favorably nrog analog Cheebtsam, uas yog raws li nyob rau hauv transients.
Yuav ua li cas yog lub binary daim ntawv ntawm kev sau ntawv?
Cia peb kawm seb yuav ua li cas xws li ib tug tseem ceeb yog tsim. Ib tug zauv binary code yuav comprise tsuas yog ob tug hais tias: zero thiab ib tug (0 thiab 1). Thaum uas siv cov ob me me yuav tau sau plaub qhov tseem ceeb: 00, 01, 10, 11. Peb tug nkag muaj yim lub xeev: 000, 001 ... 110, 111. Cov no hais tias qhov ntev ntawm lub binary code yog nyob rau hauv lub xov tooj ntawm ntswg. Qhov no qhia yuav sau siv cov nram qab no mis: N = 2m, qhov twg: m - yog tus naj npawb ntawm cov khoom, thiab N - tus xov tooj ntawm ob peb ua ke.
Hom ntawm binary cov lis dej num
Lub Microprocessors yog cov yuam sij siv los sau ib tug ntau yam ntawm cov ntaub ntawv yuav tsum tau ua. Ntsis binary code yuav ho tshaj lub peev xwm ntawm tus processor thiab nws cov nrog nco. Nyob rau hauv xws li mob, tus xov tooj ntawm ntev saib ntsoov txog ntau yam nco hlwb thiab ua nrog ib ob peb commands. Nyob rau hauv cov ntaub ntawv no, tag nrho cov cim xeeb sectors uas faib nyob rau hauv lub multi-byte binary code, pom tau hais tias raws li ib tug tib tooj.
- unsigned;
- ncaj tselyeznakovye cov lis dej num;
- landmark rov qab;
- ntxiv kos npe rau;
- Grey code;
- Grey code-Express.;
- fractional codes.
Cia peb xav txog nyob rau hauv ntau yam txhua ntawm lawv.
Unsigned binary code
Cia peb kawm saib ua li cas yuav muab tej ntaub ntawv daim ntawv. Lub unsigned integer cov lis dej num txhua ntsis (binary) tug lej nruab nrab yog cov neeg kawm ntawv ob. Yog li qhov tsawg tshaj plaws xov tooj uas yuav tsum sau nyob rau hauv daim ntawv no, yog pes tsawg thiab lub siab tshaj plaws yuav tsum sawv cev los ntawm cov hauv qab no mis: M = 2 n -1. Cov ob tug zauv yog kiag li txhais tau lub tseem ceeb ntau yam, uas yuav tsum tau qhia nyob rau hauv ib tug binary code. Cia saib tau ntawm cov hais tias nkag ntaub ntawv. Thaum uas siv cov hom unsigned tseem ceeb muaj yim me me, lub ntau yam ntawm tau tus xov tooj yog los ntawm 0 mus 255. hexadecimal code yuav muaj ib tug ntau yam ntawm 0 mus 65535. Cov yim-ntsis processors rau khaws cia thiab cov ntaubntawv povthawj siv cov zauv siv ob nco sectors uas nyob rau hauv uas nyob ib sab addressees . Ua hauj lwm nrog xws tseem ceeb muab tshwj xeeb commands.
Direct tag nrho cov lis dej num cim
Nyob rau hauv daim ntawv no ntawm binary tuav MSB yog siv los sau cov xov tooj phaj. Xoom sau raws nkaus Ii ntxiv, thiab unit - rho tawm. Raws li ib tug tshwm sim ntawm no paug ntau yam cim tooj pauv nyob rau hauv qhov tsis zoo coj. Nws hloov tawm hais tias yim-ntsis kos npe integer binary tseem ceeb xov tooj tej zaum yuav sau nyob rau hauv ntau ntawm -127 mus +127. Hexadecimal - nyob rau hauv ntau ntawm -32767 rau +32767. Lub yim-ntsis microprocessor rau khaws cia xws codes siv ob uas nyob ib sab sectors.
Ib tug disadvantage ntawm daim ntawv no ntawm cov ntaubntawv povthawj siv yog tias lub cim thiab numeric tseem ceeb khoom yuav tsum tau ua nyias. Algorithms kev pab cuam ua hauj lwm nrog cov lis dej num rau tau txais heev tham. Yuav kom hloov cov kev xaiv thiab kos npe rau cov khoom tsim nyog los siv mechanisms uas npog lub cim, uas muaj txhawb rau ib tug ntse nce nyob rau hauv software loj thiab ib tug txo nyob rau hauv nws cov kev ua tau zoo. Nyob rau hauv thiaj li yuav tshem tawm qhov disadvantage twb tau ua tswvcuab ib yam tshiab ntawm qhov tseem ceeb - rov qab binary code.
Kos npe rau hauv rov qab tseem ceeb
Qhov no daim ntawv ntawm kev sau ntawv yog txawv los ntawm lub direct code xwb nyob rau hauv uas ib tug tsis zoo pes tsawg nws yog tau ua los ntawm inverting tag nrho cov khoom ntawm tus yuam sij. Nyob rau hauv no cov thiab kos npe rau khoom yog zoo tib yam. Vim rau qhov no, lub algorithms ua hauj lwm nrog hom code yog ho yooj yim zog. Txawm li cas los, qhov rov qab tseem ceeb yuav tsum tau ib tug tshwj xeeb algorithm rau paub thawj tug lej cim, xam qhov tsis muaj nqis ntawm tus xov tooj. Ib tug reconstructing lub kos npe rau ntawm lub resultant nqi. Ntxiv mus, nyob rau hauv lub rov qab thiab pem hauv ntej cov lis dej num xov tooj rau cov ntaubntawv povthawj siv ob lub lag luam yog siv pes tsawg. Txawm tias muaj tseeb hais tias qhov no tus nqi tsis muaj ib tug zoo los yog tsis zoo kos npe rau.
Kos Npe binary tooj ntxiv code
Qhov no hom ntawm cov ntaub ntawv tsis muaj npe shortcomings ntawm yav tas los lub lag luam. Tej cov lis dej num pub direct summation ntawm ob zoo thiab tsis zoo tus xov tooj. Yog li ntawd nws yog tsis muaj kos npe rau me ntsis tsom xam. Tag nrho cov no los ua tau ua tsaug rau lub fact tias cov ntxiv tus xov tooj yog ib tug natural cim nplhaib thiab tsis muaj dag chaw, xws li cov pem hauv ntej thiab rov qab lub lag luam. Ntxiv mus, qhov tseem ceeb tshaj yog hais tias lub xam ntawm add-ons rau tsim binary cov lis dej num yog tsis tshua muaj ib qho yooj yim. Nws yog txaus rau kom rov qab tseem ceeb ntxiv ib. Thaum uas siv cov no hom ntawm cov ua cim code muaj yim me me, lub ntau yam ntawm tau tus xov tooj yog los ntawm -128 mus +127. Hexadecimal tseem ceeb yuav tau muaj ib tug ntau yam ntawm -32768 rau +32767. Lub yim-ntsis processors rau khaws cia xws xov tooj kuj siv tau ob uas nyob ib sab sectors.
Binary code ntxiv nthuav observable nyhuv uas tshwm sim no yog hu ua kos npe rau extension. Cia peb kawm saib yog dab tsi nws txhais tau hais. Cov nyhuv yog tias nyob rau hauv tus txheej txheem ntawm converting ib tug ib-byte nqi nyob rau hauv txhua me ntsis ntawm ob-byte sufficiently siab byte Cob qhov tseem ceeb kos npe rau khoom ntawm qhov uas tsis muaj byte. Nws hloov tawm hais tias rau lub cia ntawm ib tug kos npe rau tus naj npawb ntawm cov cim koj yuav siv lub high-kev txiav txim me me. Thaum zoo li no tseem ceeb muaj nuj nqis yog tsis tau hloov kiag li.
Grey code
Qhov no daim ntawv ntawm kev sau ntawv, yog yeej tseem zoo ib kauj ruam tseem ceeb. Uas yog, nyob rau hauv txoj kev hloov los ntawm ib tug tus nqi rau lwm yog hloov tsuas yog ib qho me ntsis ntawm cov ntaub ntawv. Cov kev ua yuam kev thaum nyeem ntawv cov ntaub ntawv yuav coj mus rau ib txoj kev hloov los ntawm ib tug txoj hauj lwm mus rau lwm nrog ib tug me ntsis lub sij hawm offset. Txawm li cas los, muab ib tug kiag li tsis yog tau thaum lub angular txoj hauj lwm ntawm xws li ib tug txheej txheem yog kiag li tshem tawm. Qhov kom zoo dua ntawm no code yog nws muaj peev xwm mirror cov ntaub ntawv. Piv txwv li, inverting lub high-kev txiav txim me me, koj muaj peev xwm tsuas hloov cov kev coj ntawm reference. Qhov no yog vim lub tswj tswv yim ntawm Nkij los txuam rau. Thaum cov nqi no tej zaum yuav outputted li qhov microscopic thiab ntog ntug ntawm ib tug lub cev axis ntawm kev sib hloov. Txij li thaum cov ntaub ntawv sau nyob rau hauv qhov Grey tseem ceeb yog heev dua lwm yam cim cim, uas tsis dais lub sij zauv cov ntaub ntawv, ua ntej ntxiv ua hauj lwm yuav tsum tau hloov nws yav tas los mus rau hauv ib tug dog dig binary cim. Qhov no yog ua li cas siv ib tug tshwj xeeb transducer - decoder Grey Binar. Qhov no ntaus ntawv yog yooj yim pom tau hais rau elementary logic hais ob hardware thiab software.
Grey code-Express
Grey Standard ib kauj ruam tseem ceeb rau kev daws teeb meem uas yog nyob rau hauv daim ntawv ntawm cov zauv, tsa mus rau lub hwj chim ntawm ob tug. Nyob rau hauv tus neeg mob qhov twg nws yog tsim nyog los siv lwm yam kev daws teeb meem, xws li daim ntawv ntawm cov ntaub ntawv ntuag thiab siv xwb nruab nrab feem. Raws li ib tug tshwm sim, lub ib kauj ruam tseem ceeb yog khaws cia. Txawm li cas los, nyob rau hauv no hais txog zauv ntau pib code yog tsis pes tsawg. Nws hloov mus rau lub teev nqi. Thaum lub sij hawm cov ntaub ntawv ua rau tus mem tes generated los ntawm siv ib nrab ntawm cov sib txawv ntawm cov thawj zaug thiab txo kev daws teeb meem.
Ua raws ntawm ib tug fractional tooj nyob rau hauv binary tsau-point tseem ceeb
Nyob rau hauv tus txheej txheem, peb muaj ua hauj lwm tsis tau tsuas yog tag nrho cov xov tooj tab sis kuj fractional. Tej xov tooj yuav kaw los ntawm ncaj qha, rov qab thiab ntxiv leb. qhov kev siv ntawm cov mentioned ntsiab cai tseem ceeb yog tib yam li hais tias ntawm tag nrho cov. Kom txog rau thaum tam sim no peb xav hais tias lub binary point yuav tsum muaj txoj cai ntawm lub LSB. Tab sis qhov no tsis yog cov ntaub. Nws yuav tsum tau nyob rau sab laug thiab cov tseem ceeb tshaj plaws me ntsis (nyob rau hauv cov ntaub ntawv no, lub nce mus nce los yuav tau sau ntawv xwb fractional numbers), thiab hauv nruab nrab nce mus nce los (mixed qhov tseem ceeb tej zaum yuav tau muab sau).
Sawv cev ntawm binary floating-point
Qhov no daim ntawv no yog siv los sau cov coob, los yog vice versa - yog heev me me. Raws li ib qho piv txwv, mus los yog ntau thiab tsawg interstellar atoms thiab electrons. Nyob rau hauv lub xam ntawm cov qhov tseem ceeb yuav tau mus thov ib tug binary code nrog ib tug heev loj tawm. Txawm li cas los, peb yuav tsum tsis coj mus rau hauv tus account lub cosmic deb mus rau qhov ze millimeter. Yog li ntawd, hauv daim ntawv ntawm cov tsau-point nyob rau hauv cov ntaub ntawv no yog inefficient. Yuav kom tso saib zoo li cov lis dej num siv algebraic daim ntawv. Hais tias yog, tus xov tooj yog sau raws li ib tug mantissa khoo los ntawm kaum mus rau lub hwj chim ntawm displaying cov yam kev txiav txim tus naj npawb. Thov tsum paub hais tias lub mantissa yuav tsum tsis txhob yuav ntau dua ib tug, thiab tom qab tus zauv point yuav tsum tsis txhob sau ntawv mus rau zero.
nws yog nthuav
Nws yog ntseeg hais tias cov binary calculus yog invented nyob rau hauv thaum ntxov 18th xyoo pua mathematician Gottfried Leibniz nyob rau hauv lub teb chaws Yelemees. Txawm li cas los, raws li cov kws tshawb fawb muaj tsis ntev los sab, ntev ua ntej no lub natives ntawm lub Polynesian kob ntawm Mangareva siv qhov no zoo ntawm xam. Txawm tias muaj tseeb hais tias colonization yuav luag tag pov tseg tus thawj numbering system, tus neeg tshawb fawb rov qab los rau hauv lub complex binary thiab decimal hom nyiaj. Nyob rau hauv tas li ntawd, cov txawj ntse paub txog Núñez neeg pab leg ntaubntawv hais tias cov binary code coding twb siv nyob rau hauv ancient Tuam Tshoj kom deb li deb rov qab raws li lub 9 xyoo pua BC. e. Lwm yam ancient civilizations xws li cov Maya kuj siv complex ua ke decimal thiab binary tshuab rau kev nrhiav sij hawm slots thiab astronomical cov txheej xwm.
Similar articles
Trending Now