Cov txheej txheem:

Code thiab Xeem Lub Tshuab computer hauv Tshuab Lus: 6 Kauj Ruam
Code thiab Xeem Lub Tshuab computer hauv Tshuab Lus: 6 Kauj Ruam

Video: Code thiab Xeem Lub Tshuab computer hauv Tshuab Lus: 6 Kauj Ruam

Video: Code thiab Xeem Lub Tshuab computer hauv Tshuab Lus: 6 Kauj Ruam
Video: hlub tsis khuv xim txoj sia Part 3 2024, Hlis ntuj nqeg
Anonim
Image
Image

Hauv Cov Lus Qhia no, Kuv yuav qhia koj yuav ua li cas thiab ntsuas lub khoos phis tawj li cas hauv tshuab lus. Hom tshuab yog hom lus ib txwm muaj ntawm cov khoos phis tawj. Vim tias nws tau tsim los ntawm cov hlua ntawm 1s thiab 0s, nws tsis yooj yim los ntawm tib neeg. Txhawm rau ua haujlwm nyob ib puag ncig qhov no, peb sau cov program ua ntej hauv qib lus zoo li C ++ lossis Java ces siv cov khoos phis tawj tshwj xeeb los txhais lawv rau hauv 1s thiab 0s khoos phis tawj nkag siab. Kev kawm paub tus lej hauv qib lus yog qhov tsis muaj lub hlwb tab sis qhia luv luv rau cov lus siv lub tshuab tuaj yeem muab kev nkag siab zoo txog kev siv computer li cas thiab nce kev txaus siab ntawm cov cuab yeej tseem ceeb no.

Txhawm rau ntsuas thiab ntsuas lub tshuab lus program, peb xav tau nkag mus rau lub khoos phis tawj uas tsis zoo uas nws lub tshuab cov lus nkag siab yooj yim. Cov khoos phis tawj ntiag tug yog qhov nyuaj dhau los xav txog. Kev daws teeb meem yog siv Logisim, lub logic simulator, uas ua haujlwm ntawm lub khoos phis tawj ntiag tug. Nrog Logisim peb tuaj yeem sim ua lub khoos phis tawj uas ua tau raws li peb xav tau. Cov vis dis aus saum toj no muab tswv yim rau koj tias peb tuaj yeem ua tiav nrog Logisim li cas.

Rau lub khoos phis tawj tsim, Kuv yoog raws ib qho los ntawm kuv li Kindle e -book Tsim Koj Tus Kheej Lub Computer - Los Ntawm Kos. Kuv pib nrog BYOC khoos phis tawj tau piav qhia nyob ntawd thiab txiav nws mus rau qhov sib txawv yooj yim BYOC-Kuv (Kuv rau Kev Qhia) peb yuav siv hauv Cov Lus Qhia no.

BYOC-Kuv lub tshuab lus yog yooj yim thiab nkag siab yooj yim. Koj yuav tsis xav tau kev paub tshwj xeeb ntawm computer lossis programming. Txhua yam xav tau yog lub siab xav paub thiab xav kawm

Nyeem ntxiv

Koj yuav xav tsis thoob vim li cas peb siv "tshuab" los piav qhia lub computer thaum nws tsis yog lub tshuab siv tshuab. Yog vim li cas yog keeb kwm; thawj cov cuab yeej siv suav nrog cov tshuab thiab lub log. Allan Sherman cov nkauj, "Nws yog txhua lub zog mus clickety-clack …" tsuas yog tawm ib puas xyoo lossis ob xyoos. Nyeem ntxiv txog kev suav ua ntej ntawm no.

Kauj Ruam 1: Daim Ntawv Teev Npe

Tshuab Hom Hierarchy thiab Codes
Tshuab Hom Hierarchy thiab Codes

Daim ntawv teev npe luv. Tsuas yog ob yam khoom no xav tau, ob qho rub tawm tau dawb:

  1. "Logisim-win-2.7.1.exe"-Logisim yog qhov nrov thiab siv tau yooj yim simulators. Rub tawm Logisim cov ntaub ntawv ua tiav los ntawm no ces tsim kev txiav luv hauv qhov chaw yooj yim zoo li koj lub desktop. Ob npaug nias rau Logisim lub cim kom qhib nws. Nco tseg: Logisim siv Java Runtime Pob nyob ntawm no. Tej zaum koj yuav raug nug kom rub nws.
  2. BYOC-I-Full.cir "-Rub cov ntawv logisim Circuit hauv qab no.

Tua Logisim ces nyem "File-Open" thiab thauj cov ntaub ntawv BYOC-I-Full.cir. Daim duab saum toj no qhia txog Logisim chaw ua haujlwm. BYOC-Kuv tau sawv cev los ntawm subcircuit block. Txuas nrog sab nraud yog ob lub tswv yim, Pib dua thiab Khiav, thiab hexadecimal qhia rau BYOC-Kuv cov ntawv sau npe thiab kev nco nco.

BYOC-Kuv qhov kev nco nco tau npaj ua ntej nrog cov haujlwm yooj yim uas suav los ntawm 1 txog 5 hauv A register. Txhawm rau ua (Khiav) txoj haujlwm, ua raws cov theem no.

Kauj Ruam 1 - Nyem rau ntawm Poke Tool. Tus cursor yuav tsum hloov mus rau qhov poking "ntiv tes". Kauj Ruam 2 - Poke Reset input ob zaug, ib zaug hloov nws mus rau "1" thiab rov hloov nws rov mus rau "0". Qhov no rov pib dua BYOC -Kuv kom pib qhov haujlwm ntawm qhov chaw nyob 0. Step 3 - Poke the Run input ib zaug kom hloov nws mus rau "1". Daim ntawv sau npe yuav tsum qhia tus lej hloov pauv ntawm 1 txog 5 ces rov ua dua.

Yog tias koj xav tshawb xyuas Logisim lub peev xwm, nyem qhov Pab Txuas hauv Cov Ntawv Qhia Bar. Los ntawm qhov ntawd, koj tuaj yeem tshawb xyuas Logisim "Tutorial", "User Guide", thiab "Library Reference". Kev qhia video zoo heev nyob ntawm no.

Kauj Ruam 2: Tshuab Hom Hierarchy thiab Codes

Tshuab Hom Hierarchy thiab Codes
Tshuab Hom Hierarchy thiab Codes

BYOC-Kuv lub khoos phis tawj ua haujlwm raws li cov phiaj xwm sau ua lus tshuab. BYOC-I cov haujlwm, nyeg, yog tsim los ntawm cov lus qhia ua tiav hauv ib ntu uas tau piav qhia zoo. Txhua qhov kev qhia yog ua los ntawm cov lej ntev ntev uas sawv cev rau ntau yam kev ua haujlwm ntawm BYOC-I. Thaum kawg, cov lej no suav nrog cov hlua ntawm 1s thiab 0s uas yog lub tshuab lus BYOC-Kuv tau ua tiav.

Los ntawm txoj kev piav qhia, peb yuav pib nrog cov lej thiab ua haujlwm peb txoj hauv kev mus txog qib haujlwm. Tom qab ntawd peb yuav sau cov program yooj yim, thauj nws mus rau hauv BYOC-Kuv lub cim xeeb, thiab ua nws.

Codes suav nrog cov lej ruaj khov ntawm binary (1 thiab 0) tus lej lossis cov khoom, kom luv. Piv txwv li, cov lus hauv qab no qhia tag nrho cov lej muaj peev xwm ua tau (16 hauv txhua qhov) rau tus lej 4 qhov dav. Qhia ib sab ntawm tus lej yog tus lej hexadecimal (puag 16) thiab lej sib npaug. Hexadecimal tau siv hauv kev xa mus rau binary qhov tseem ceeb raws li nws tau nrawm dua binary thiab hloov pauv tau yooj yim los ntawm binary ntau dua decimal. Qhov "0x" ua ntej tso cai rau koj paub tus lej hauv qab no yog hexadecimal lossis "hex" kom luv.

Binary - Hexadecimal - Cov lej zauv 0x000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000 tus ๆ tus lej lej Hexadecimal

Qhov dav ntawm tus lej txiav txim seb muaj pes tsawg yam khoom tuaj yeem sawv cev. Raws li tau sau tseg, 4-ntsis txoj cai dav dav saum toj no tuaj yeem sawv cev txog 16 yam khoom (0 txog 15); uas yog, 2 zaug 2 coj plaub zaug lossis 2 rau 4 lub zog sib npaug 16. Feem ntau, tus lej ntawm cov khoom sawv cev yog 2 tsa rau lub zog nth. Nov yog cov npe luv ntawm n-ntsis code peev xwm.

n - Tus naj npawb ntawm Cov Khoom 1 22 43 84 165 326 647 1288 256

BYOC-Kuv lub khoos phis tawj txoj cai dav tau xaiv kom haum rau cov khoom kom sawv cev los ntawm cov cai. Piv txwv li, muaj plaub Hom Kev Qhia, yog li 2-ntsis txoj cai dav haum. Nov yog BYOC-Kuv cov lej nrog cov lus piav qhia luv ntawm txhua.

Kev Qhia Ntaus Tus Qauv (tt) Muaj plaub hom lus qhia: (1) MVI - Tsiv tus nqi 8 -ntsis tam sim ntawd rau hauv lub cim xeeb sau npe. Lub cim xeeb sau npe yog lub cuab yeej uas khaws cov ntaub ntawv los siv rau kev suav, (2) MOV - Tshem cov ntaub ntawv los ntawm ib qho mus rau lwm qhov, (3) RRC - Ua daim ntawv sau npe -rau -suav, thiab (4) JMP - Dhia mus rau qhov kev qhia sib txawv tsis yog txuas ntxiv ntawm cov lus qhia tom ntej. BYOC-I Cov Lus Qhia Hom Codes tau txais yog raws li hauv qab no:

00 MVI01 MOV10 RRC11 JMP

Sau Npe Tus lej (dd thiab ss) BYOC-Kuv muaj plaub tus lej 8-ntsis muaj peev xwm khaws cov txiaj ntsig los ntawm 0 txog 255. Tus lej 2-ntsis txaus los xaiv plaub lub npe:

00 F rau npe 01 E sau npe 10 D rau npe 11 A rau npe

Cov lej suav (ccc) BYOC-Kuv txhawb nqa plaub qhov lej/kev ua haujlwm logic. Txhawm rau tso cai rau kev nthuav dav yav tom ntej rau yim qhov kev suav, siv 3-ntsis code tau siv:

000 ADD, ntxiv ob 8-ntsis qhov tseem ceeb hauv cov npe teev tseg thiab khaws cov txiaj ntsig hauv ib ntawm cov ntawv sau npe 001 SUB, rho ob qhov 8-ntsis qhov tseem ceeb hauv cov npe teev tseg thiab khaws cov txiaj ntsig hauv ib qho ntawm cov npe 010-011 tshwj tseg rau yav tom ntej siv 100 THIAB, qhov laj thawj THIAB ob qhov 8-ntsis qhov tseem ceeb hauv cov npe teev tseg thiab khaws cov txiaj ntsig hauv ib qho ntawm cov npe 101 LOS YOG, qhov laj thawj LOS YOG ob qhov 8-ntsis qhov tseem ceeb hauv cov npe teev tseg thiab khaws cov txiaj ntsig hauv ib qho ntawm cov npe 110 txog 111, Txuag rau yav tom ntej siv

Dhia Code (j) Ib tus lej 1-ntsis uas qhia tias kev dhia tsis muaj qhov tsis raws cai (j = 1) lossis ua raws li qhov tsis suav xam qhov tshwm sim (j = 0).

Cov Ntaub Ntawv/Chaw Nyob (v… v)/(a… a) 8-ntsis cov ntaub ntawv tuaj yeem suav nrog hauv qee cov lus qhia sawv cev qhov tseem ceeb ntawm 00000000 txog 11111111 lossis 0 txog 255 decimal. Cov ntaub ntawv no yog 8-ntsis dav rau kev khaws cia hauv BYOC-Kuv tus lej 8-ntsis. Nrog rau zauv zauv zauv, peb tsis qhia ua zeros. Nrog lub khoos phis tawj lej, peb qhia ua zeros tab sis lawv tsis cuam tshuam rau tus nqi. 00000101 yog tus lej zoo ib yam 101 lossis 5 zauv.

Cov Lus Pom Zoo

Binary Notation - https://learn.sparkfun.com/tutorials/binaryHexadecimal Notation -

Nyeem ntxiv

Lub tswv yim ntawm kev siv cov lej los tsav cov txheej txheem rov qab mus ntev. Ib qho piv txwv txaus nyiam yog Jacquard Loom. Kev siv tshuab tsis siv neeg tau tswj hwm los ntawm saw hlau ntawm daim npav ntoo uas lub qhov tau ua qhov drilled sawv cev rau cov lej sib txawv rau cov xov paj xim. Kuv pom kuv thawj tus nyob hauv Scotland qhov uas nws tau siv los ua cov paj ntoo tart. Nyeem ntxiv txog Jacquard Looms ntawm no.

Kauj Ruam 3: Lub cev ntawm BYOC-Kuv Cov Lus Qhia

Anatomy ntawm BYOC-Kuv Cov Lus Qhia
Anatomy ntawm BYOC-Kuv Cov Lus Qhia

Muab BYOC-Kuv cov lej, peb txav mus rau qib tom ntej, cov lus qhia. Txhawm rau tsim kev qhia rau BYOC-I, peb tso cov lej ua ke hauv qhov kev txiav txim tshwj xeeb thiab hauv cov chaw tshwj xeeb hauv cov lus qhia. Tsis yog txhua tus lej tshwm nyob rau txhua qhov lus qhia tab sis, thaum lawv ua, lawv nyob hauv ib qho chaw tshwj xeeb.

Hom kev qhia MVI xav tau ntau tshaj, 12 hauv tag nrho. Los ntawm kev ua cov lus qhia 12 ntsis hauv qhov ntev, peb ua raws txhua cov lus qhia. Tsis siv (yog li "tsis quav ntsej") cov khoom tau muab tus nqi 0. Nov yog BYOC-Kuv Cov Lus Qhia Teeb.

  1. Tsiv Tawm Tam Sim No (MVI) - 00 dd vvvvvvvvFunction: Tsiv 8 -ntsis cov ntaub ntawv tus nqi V = vvvvvvvv mus rau qhov chaw sau npe dd. Tom qab ua tiav, sau npe dd yuav muaj tus nqi vvvvvvvv. Cov ntawv luv: MVI R, V qhov R yog A, D, E, lossis F. Piv txwv: 00 10 00000101 - MVI D, 5 - Tsiv tus nqi 5 mus rau D rau npe.
  2. Txav Mus Sau Npe Sau Npe (MOV) - 01 dd ss 000000Function: Tshem cov ntaub ntawv los ntawm qhov chaw sau npe ss mus rau qhov xav tau sau npe dd. Tom qab ua tiav, ob qho kev sau npe muaj tus nqi zoo ib yam li cov npe sau npe. Cov ntawv luv: MOV Rd, Rs qhov Rd yog qhov chaw rau npe A, D, E, lossis F thiab Rs yog qhov chaw sau npe A, D, E, lossis F. Piv txwv: 01 11 01 000000 - MOV A, E - Tsiv tus nqi rau npe E txhawm rau sau npe A.
  3. Sau npe rau Sau Npe Suav (RRC) - 10 dd ss ccc 000Function: Ua qhov kev suav sau ccc siv qhov chaw sau npe ss thiab sau npe qhov chaw dd ces khaws cov txiaj ntsig hauv qhov chaw rau npe sau npe. Txoj kev); SUB Rd, Rs (ccc = 001 Rd - Rs khaws hauv Rd); THIAB Rd, Rs (ccc = 100 Rd THIAB Rs khaws hauv Rd); LOS YOG Rd, Rs (ccc = 101 Rd LOSSIS khaws cia hauv Rd). Piv txwv: 10 00 11 001 000 - SUB F, A - Rho tawm tus nqi hauv A register los ntawm F register nrog qhov tshwm sim hauv F register.
  4. Dhia mus rau Kev Qhia Sib Txawv (JMP) - 11 j 0 aaaaaaaaFunction: Hloov kev ua tiav mus rau lwm qhov kev qhia nyob ntawm chaw nyob aaaa aaaa (a) Tsis muaj kev txwv (j = 1) -11 1 0 aaaaaaaaAbbreviation: JMP L qhov L yog qhov chaw nyob aaaa aaaaExample: 11 1 0 00001000 - JMP 8 - Hloov kev ua tiav rau qhov chaw nyob 8. (b) Raws li txoj cai (j = 0) thaum qhov kev suav yav dhau los ua rau tsis xoom tshwm sim - 11 0 0 aaaaaaaaAbbreviation: JNZ L qhov L yog chaw nyob aaaa aaaa. Example: 11 0 0 00000100 JNZ 4 Yog tias qhov kev suav zaum kawg tau ua rau tus nqi tsis xoom, hloov kev ua tiav rau qhov chaw nyob 4.

Cov lus qhia cov lus yog suav sab laug (qhov tseem ceeb tshaj plaws MSB) mus rau sab xis (tsawg kawg qhov tseem ceeb LSB) los ntawm 11 txog 0. Qhov kev txiav txim ruaj khov thiab qhov chaw ntawm cov lej muaj raws li hauv qab no:

Khoom-Code11-10 Qhia hom9-8 Destination Register7-6 Source Register5-3 Calculation: 000-ntxiv; 001 - rho tawm; 100 - cov ntsiab lus THIAB; 101 - zaj lus OR7-0 Tus nqi tsis tu ncua v… v thiab a… a (0 txog 255)

Cov txheej txheem qhia yog muab sau ua piv txwv hauv daim duab saum toj no. Nco tseg cov txheej txheem thiab ua kom pom zoo ntawm cov lej hauv txhua qhov kev qhia. Qhov tshwm sim yog kev tsim qauv yooj yim rau BYOC-Kuv thiab nws ua cov lus qhia yooj yim rau tib neeg nkag siab.

Kauj Ruam 4: Coding Lub Computer Qhia

Coding Computer Qhia
Coding Computer Qhia

Ua ntej txav mus rau qib kev kawm, cia peb tsim qee cov lus qhia piv txwv siv BYOC-I Cov Lus Qhia Teeb saum toj no.

1. Tsiv tus nqi 1 mus rau npe A. BYOC-Kuv cov npe tuaj yeem khaws qhov tseem ceeb ntawm 0 txog 255. Hauv qhov no, sau npe A yuav muaj tus nqi 1 (00000001 binary) tom qab ua tiav cov lus qhia.

Cov ntawv luv: MVI A, 1Codes Xav tau: Hom MVI - 00; Qhov Chaw Sau Npe A - 11; Tus Nqi - 00000001 Cov Lus Qhia: 00 11 00000001

2. Tshem cov ntsiab lus ntawm kev tso npe A mus rau npe D. Tom qab ua tiav, ob daim ntawv sau npe yuav muaj tus nqi thaum xub thawj hauv npe A.

Cov ntawv luv: MOV D, A (Nco ntsoov, lub hom phiaj yog thawj thiab qhov thib ob hauv cov npe) Cov lej xav tau: Hom MOV - 01; Qhov chaw rau npe D -10; Sau Npe Sau Npe A - 11 Cov Lus Qhia: 01 10 11 000000

3. Ntxiv cov ntsiab lus ntawm kev sau npe D rau npe A thiab khaws hauv npe A. Tom qab ua tiav, sau npe tus lej yuav yog tus lej ntawm tus lej qub ntawm kev sau npe A thiab sau npe D.

Cov ntawv luv: ADD A, D (Cov txiaj ntsig tau muab khaws cia rau hauv qhov chaw sau npe) Cov lej xav tau: Hom RRC - 10; Qhov chaw rau npe A - 11; Sau Npe Sau Npe D - 10; Kev Suav Ntxiv - 000 Cov Lus Qhia: 10 11 10 000 000 (ccc yog thawj 000 - ntxiv)

4. Dhia rau tsis xoom rau qhov chaw nyob 3. Yog tias qhov txiaj ntsig ntawm qhov kev suav zaum kawg tsis yog xoom, kev ua tiav yuav hloov mus rau cov lus qhia ntawm qhov chaw nyob. Yog tias xoom, kev rov ua tiav ntawm cov lus qhia hauv qab no.

Cov ntawv luv: JNZ 3Codes Yuav Tsum Tau: Hom JMP - 11; Hom dhia - 0; Chaw Nyob - 00000003 Cov Lus Qhia: 11 0 0 00000003 (Hom dhia yog thawj 0)

5. Dhia yam tsis muaj qhov chaw nyob 0. Tom qab ua tiav, kev hloov pauv mus rau kev qhia ntawm qhov chaw nyob.

Cov ntawv luv: JMP 0Code Yuav Tsum Tau: Hom JMP - 11; Hom dhia - 1; Chaw Nyob - 00000000 Cov Lus Qhia; 11 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Thaum lub tshuab coding yog me ntsis nkees, koj tuaj yeem pom tias nws tsis yooj yim li nyuaj. Yog tias koj tau siv tshuab coding rau qhov tiag, koj yuav siv lub khoos phis tawj hu ua assembler los txhais los ntawm cov ntawv luv (uas yog hu ua sib dhos code) rau tshuab code.

Kauj Ruam 5: Anatomy ntawm Computer Program

Anatomy ntawm Computer Program
Anatomy ntawm Computer Program

Ib lub khoos phis tawj yog daim ntawv teev cov lus qhia uas lub khoos phis tawj ua haujlwm pib thaum pib ntawm cov npe txuas ntxiv hauv cov npe mus rau qhov kawg. Cov lus qhia zoo li JNZ thiab JMP tuaj yeem hloov qhov kev qhia uas tau ua tom ntej. Txhua qhov kev qhia hauv cov npe nyob ib qhov chaw nyob hauv computer lub cim xeeb pib ntawm 0. Lub cim BYOC-Kuv tuaj yeem tuav cov npe ntawm 256 cov lus qhia, ntau dua li txaus rau peb lub hom phiaj.

Cov khoos phis tawj raug tsim los ua haujlwm tiav. Rau peb txoj haujlwm, peb yuav xaiv txoj haujlwm yooj yim, suav los ntawm 1 txog 5. Pom tseeb, tsis muaj "suav" kev qhia, yog li thawj kauj ruam yog txhawm rau txhawm rau ua txoj haujlwm rau hauv cov kauj ruam uas tuaj yeem ua los ntawm BYOC-Kuv zoo heev teeb qhia ntawv tsawg.

Kauj Ruam 1 Tsiv 1 mus rau npe AStep 2 Txav mus rau npe A rau npe DStep 3 Ntxiv rau npe D txhawm rau sau npe A thiab khaws cov txiaj ntsig hauv npe AStep 4 Tsiv 5 mus rau npe EStep 5 Tshem tawm npe A los ntawm kev sau npe E thiab khaws cov txiaj ntsig hauv npe EStep 6 Yog qhov kev suav rho tawm tsis yog xoom, rov qab mus rau Kauj Ruam 4 thiab suav txuas ntxiv 7

Cov kauj ruam tom ntej yog txhais cov kauj ruam no rau hauv BYOC-Kuv cov lus qhia. BYOC-Kuv cov haujlwm pib ntawm chaw nyob 0 thiab tus lej sib txuas ua ke. Dhia chaw nyob qhov chaw tau ntxiv zaum kawg tom qab txhua cov lus qhia nyob hauv qhov chaw..

Chaw Nyob: Qhia - Cov Ntawv Teev Npe; Nqe lus piav qhia 0: 00 11 00000001 - MVI A, 1; Tsiv 1 mus rau npe A1: 01 10 11 000000 - MOV D, A; Txav mus rau npe A mus rau npe D2: 10 11 10 000 000 - ADD A, D; Ntxiv rau npe D txhawm rau sau npe A thiab khaws cov txiaj ntsig hauv kev sau npe A3: 00 01 00 00000101 - MVI E, 5; Txav mus rau 5 sau npe E4: 10 01 11 001 000 - SUB E, A; Tshem tawm npe A los ntawm kev sau npe E thiab khaws cia ua rau sau npe E5: 11 0 0 00000010 - JNZ 2; Yog tias qhov kev rho tawm tsis yog xoom, rov qab mus rau qhov chaw nyob 3 thiab suav txuas ntxiv 6: 11 1 0 00000000 - JMP 0; Yog tias qhov rho tawm tau xoom, rov qab thiab pib dua

Ua ntej hloov qhov program mus rau cim xeeb, cov lej qhia kev qhia binary yuav tsum tau hloov mus rau hexadecimal los siv nrog Logisim Hex Editor. Ua ntej, faib cov lus qhia ua peb pawg ntawm 4 khoom txhua. Tom qab ntawd txhais cov pab pawg mus rau hexadecimal siv lub rooj hauv Kauj Ruam 2. Tsuas yog peb tus lej hexadecimal kawg (hauv kab ntawv hauv qab) yuav siv.

Chaw Nyob - Qhia Binary - Qhia Binary Split - Qhia (Hex) 0 001100000001 0011 0000 0001 - 0x03011 011011000000 0110 1100 0000 - 0x06C02 101110000000 1011 1000 0000 - 0x0B803 000100000101 0001 0000 0101 - 0x01054 100111001000 0000 1100 - 001 1100 - 001 1100 - 001 1100 - 001 1100 - 001 1100 011 001 1100 011 001 1100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 uas uas uas uas uas ສົ່ງ ຄືນ uas ໃຫມ່ 111000000010 1110 0000 0000 - 0x0E00

Nws yog lub sijhawm hloov qhov haujlwm mus rau BYOC-Kuv lub cim xeeb rau kev sim.

Kauj Ruam 6: Hloov Txoj Haujlwm rau Nco thiab Xeem

Hloov Txoj Haujlwm Rau Kev Nco thiab Kev Xeem
Hloov Txoj Haujlwm Rau Kev Nco thiab Kev Xeem
Hloov Txoj Haujlwm Rau Kev Nco thiab Kev Xeem
Hloov Txoj Haujlwm Rau Kev Nco thiab Kev Xeem

Saib ntawm Logisim "qhov tseem ceeb" Circuit, BYOC-Kuv thaiv tau qhia yog lub cim rau lub tshuab computer tiag tiag sau tias "BYOC-I" hauv Explorer Pane. Txhawm rau nkag mus rau ib qho program rau hauv BYOC-Kuv lub cim xeeb:

  1. Txoj cai nyem rau ntawm BYOC-Kuv thaiv (hu ua "subcircuit") thiab xaiv (hover dua thiab nyem sab laug) "Saib BYOC-I".
  2. Qhov Circuit Court BYOC-I yuav tshwm sim hauv Chaw Ua Haujlwm. Txoj nyem rau ntawm lub cim "Program Memory" thiab xaiv "Kho Cov Qauv..".
  3. Siv Logisim Hex Editor, nkag mus rau tus lej hexadecimal (siab tawv xwb) raws li qhia saum toj no.

Tam sim no koj tau npaj tiav los ua txoj haujlwm. Rov qab mus rau lub ntsiab lus tseem ceeb los ntawm ob npaug nias "BYOC-I" hauv Explorer Pane. Khiav thiab Pib dua cov tswv yim yuav tsum yog "0" kom pib. Siv lub Poke Tool, xub hloov Pib dua rau "1" tom qab ntawd rov mus rau "0". Qhov no ua rau pib chaw nyob 0x0000 thiab npaj BYOC-I Circuit Court rau kev ua tiav. Tam sim no poke cov lus nkag mus rau "1" thiab qhov program yuav ua tiav. (Faj seeb: Koj lub ntsiab yuav tsum tau coj mus Tswj -K ib zaug kom pib lub Logisim moos. Qhov no yog qhov tshwj xeeb uas tso cai rau koj kom nres lub Logisim moos thiab nqis los ntawm txoj haujlwm los ntawm kev kov Control-T ntau zaus. Sim nws qee zaum!)

Lub Logisim moos tau teeb tsa rau ntau qhov ntau zaus. Raws li rub tawm nws yog 8 Hz (8 mus rau ib pliag). Txoj hauv kev BYOC-Kuv lub khoos phis tawj tau tsim, txhua qhov kev qhia yuav siv plaub teev mus los kom tiav. Yog li, los xam BYOC-Kuv nrawm, faib lub moos zaus ntawm 4. Ntawm 8 Hz, nws qhov nrawm yog 2 cov lus qhia ib pliag. Koj tuaj yeem hloov lub moos los ntawm txhaj "Simulate" ntawm lub cuab yeej bar thiab xaiv "Zis Zaus". Qhov ua tau yog 0.25 Hz txog 4100 Hz. Kev qeeb qeeb ntawm 8 Hz tau xaiv yog li koj tuaj yeem saib cov suav hauv A register.

Qhov siab tshaj plaws ntawm BYOC-Kuv simulation (~ 1000 cov lus qhia ib pliag) qeeb heev piv rau cov khoos phis tawj niaj hnub no. Kho vajtse version ntawm BYOC lub computer piav qhia hauv kuv phau ntawv ua tiav ntau dua 12 lab cov lus qhia ib pliag!

Kuv vam tias Cov Lus Qhia no tau piav qhia lub tshuab cov lus tsis zoo thiab muab kev nkag siab rau hauv yuav ua li cas khoos phis tawj ua haujlwm ntawm lawv qib pib. Txhawm rau txheeb xyuas koj qhov kev nkag siab, sim sau ob txoj haujlwm hauv qab no.

  1. Sau qhov program uas pib ntawm 5 thiab suav mus rau 0. (ANS. Count5to0.txt hauv qab no)
  2. Pib ntawm 2, suav los ntawm 3 kom txog rau tus lej ntau dua 7. Koj tuaj yeem ua tus lej lej siab me ntsis, txheeb xyuas 8 paub tias nws yuav tsaws rau ntawd ces rov pib dua. Sau koj cov haujlwm hauv ntau txoj hauv kev uas tau sim tiag tiag yog tias suav "tshaj" tus lej tshwj xeeb. Hint: Tshawb nrhiav qhov tshwm sim thaum rho tawm ua rau tus lej tsis zoo, hais 8 - 9 = -1 piv txwv. Tom qab ntawd sim nrog qhov laj thawj THIAB sim seb MSB hauv tus lej 8-ntsis yog "1". (ANS. ExcessCount.txt)

Koj puas tuaj yeem xav txog lwm yam teeb meem nyuaj rau BYOC-Kuv lub khoos phis tawj? Muab nws cov kev txwv, nws tuaj yeem ua dab tsi ntxiv? Qhia koj cov kev paub nrog kuv ntawm [email protected]. Yog tias koj xav siv coding microprocessors, txheeb xyuas kuv lub vev xaib www.whippleway.com. Muaj kuv nqa lub tshuab coding rau cov txheej txheem niaj hnub zoo li ATMEL Mega series siv hauv Arduinos.

Pom zoo: