Cov txheej txheem:

Binary rau Xeem Zauv: 8 Kauj Ruam
Binary rau Xeem Zauv: 8 Kauj Ruam

Video: Binary rau Xeem Zauv: 8 Kauj Ruam

Video: Binary rau Xeem Zauv: 8 Kauj Ruam
Video: 10 Nqi qhia tias koj tab tom yuav txom nyem ( mloog los mus hloov yus tus kheej) 2024, Kaum ib hlis
Anonim
Binary rau Decimal Calculator
Binary rau Decimal Calculator

Txog qib kaum ib lub tshuab computer, kuv yuav tsum txiav txim siab txog qhov haujlwm kawg. Thaum xub thawj kuv tsis paub yuav ua dab tsi vim tias nws yuav tsum suav nrog qee yam khoom siv kho vajtse. Tom qab ob peb hnub, kuv tus phooj ywg qhia kuv kom ua ib qhov haujlwm raws li plaub qhov ntxiv peb tau tsim ob peb lub hlis dhau los. Tom qab hnub ntawd, siv kuv tus lej plaub ntxiv, kuv muaj peev xwm los tsim binary rau decimal converter.

Tsim txoj haujlwm no yuav tsum muaj kev tshawb fawb ntau, uas suav nrog kev nkag siab ntau npaum li cas thiab ib nrab tus neeg ua haujlwm li cas.

Kauj Ruam 1: Cov Ntaub Ntawv Xav Tau

Rau qhov haujlwm no, koj yuav xav tau cov ntaub ntawv hauv qab no:

  • Arduino UAS
  • plaub daim txiag zeb
  • cuaj-volt roj teeb
  • xya XOR rooj vag (2 XOR chips)
  • xya THIAB rooj vag (2 THIAB chips)
  • peb LOSSIS lub rooj vag (1 LOS YOG nti)
  • tsib LEDs
  • yim 330 ohm resistors
  • LCD zaub
  • plaub tus txiv neej-poj niam xov hlau
  • ntau ntawm cov txiv neej-txiv neej kab
  • hlau stripper
  • nquag anode RGB LED

Tus nqi (tsis suav cov xov hlau): $ 79.82

Txhua yam khoom siv tus nqi tau pom ntawm ABRA cov khoom siv hluav taws xob.

Kauj Ruam 2: Nkag Siab 4 Bit Adder

Nkag Siab 4 Bit Adder
Nkag Siab 4 Bit Adder

Ua ntej peb pib, koj yuav tsum nkag siab tias tus lej plaub-ntsis ntxiv ua haujlwm li cas. Thaum peb saib thawj zaug ntawm Circuit no, koj yuav pom tias muaj ib nrab qhov txuas hauv Circuit Court thiab peb qhov txuas txuas ntxiv. Vim tias plaub-tus neeg ntxiv yog sib xyaw ua ke ntawm ib nrab thiab ib nrab ntxiv, Kuv tau tshaj tawm cov vis dis aus piav qhia ob hom tshuaj ntxiv ua haujlwm li cas.

www.youtube.com/watch?v=mZ9VWA4cTbE&t=619s

Kauj Ruam 3: Tsim 4 Bit Adder

Tsim 4 Bit Adder
Tsim 4 Bit Adder
Tsim lub 4 Bit Adder
Tsim lub 4 Bit Adder

Piav qhia yuav ua li cas tsim plaub-ntsis tus neeg siv yog qhov nyuaj heev, vim nws cuam tshuam nrog ntau txoj hlua. Raws li cov duab no, Kuv tuaj yeem muab qee qhov kev dag rau koj txhawm rau txhawm rau tsim cov phiaj xwm no. Ua ntej, txoj hauv kev koj npaj koj cov logic chips tuaj yeem yog qhov tseem ceeb heev. Txhawm rau kom muaj kev sib txuas zoo, xaj koj cov chips hauv qhov kev txiav txim no: XOR, THIAB, LOS YOG, THIAB, XOR. Los ntawm kev xaj qhov no, tsis tsuas yog koj lub voj voog yuav zoo, tab sis nws kuj tseem yuav yooj yim rau koj los npaj.

Lwm qhov ua kom yuam kev loj yog tsim txhua tus neeg ntxiv ib zaug thiab los ntawm sab xis mus rau sab laug. Qhov yuam kev ib txwm uas ntau tus neeg tau ua yog ua txhua tus neeg ntxiv rau tib lub sijhawm. Los ntawm kev ua qhov no, koj tuaj yeem cuam tshuam hauv cov kab. Ib qho yuam kev hauv 4-ntsis ntxiv tuaj yeem ua rau txhua yam tsis ua haujlwm,

Kauj Ruam 4: Muab Lub Hwj Huam thiab Av rau hauv Circuit

Siv lub roj teeb 9-volt, muab lub zog thiab hauv av rau hauv lub khob cij uas yuav muaj plaub-ntsis ntxiv. Rau qhov seem 3 daim ntawv qhia zaub mov, muab lub zog thiab av rau nws los ntawm Arduino UNO.

Kauj Ruam 5: Teeb LEDs

Cov kab hluav taws xob LEDs
Cov kab hluav taws xob LEDs

Rau txoj haujlwm no, tsib lub LEDs yuav raug siv ua cov khoom siv tawm thiab tso tawm. Raws li cov cuab yeej tso tawm, LED yuav teeb tus lej binary, nyob ntawm seb cov tswv yim muab tso rau hauv plaub qhov ntxiv. Raws li cov cuab yeej siv tswv yim, nyob ntawm seb LEDs nyob thiab tawm, peb yuav tuaj yeem npaj qhov hloov pauv tus lej binary ntawm LCD zaub raws li tus lej lej. Txhawm rau xaim lub LED, koj yuav txuas ib qho ntawm cov lej tsim los ntawm plaub qhov ntxiv rau anode ceg ntawm LED (ceg ntev ntawm LED), txawm li cas los xij ntawm ob qho no, tso 330 ohm resistor. Tom qab ntawd txuas cov cathode ceg ntawm LED (luv luv ntawm LED) rau hauv av tsheb nqaj hlau. Hauv nruab nrab ntawm tus tiv thaiv thiab cov xov tooj sib txuas, txuas tus txiv neej rau txiv neej xaim mus rau tus lej digital ntawm Arduino UNO. Rov ua cov kauj ruam no rau peb seem ntxiv thiab nqa mus. Cov koob digital kuv tau siv yog 2, 3, 4, 5 thiab 6.

Kauj Ruam 6: Kev Txuas Hluav Taws Xob Common Anode RGB LED

Cov Hluav Taws Xob Cov Hluav Taws Xob Hluav Taws Xob Anode RGB LED
Cov Hluav Taws Xob Cov Hluav Taws Xob Hluav Taws Xob Anode RGB LED

Txog txoj haujlwm no, lub hom phiaj ntawm RGB LED no yog txhawm rau hloov xim thaum twg los xij tus lej lej zauv tshiab tau tsim ntawm LCD zaub. Thaum koj xub saib ntawm qhov anode RGB coj, koj yuav pom tias nws muaj 4 ceg; ceg liab-teeb, lub zog (anode) ceg, ceg ntsuab-lub teeb, thiab ceg-lub teeb xiav. Lub hwj chim (anode) ceg yuav txuas nrog txoj kab hluav taws xob, tau txais 5 volts. Txuas peb ceg xim ntxiv nrog 330 ohm resistors. Ntawm qhov kawg ntawm tus tiv thaiv, siv tus txiv neej rau txiv neej xaim txuas nws mus rau PWM dgital tus pin ntawm Arduino. PWM tus lej digital yog ib tus lej digital nrog cov kab ntsais ib sab ntawm nws. PWM pins kuv siv yog 9, 10, thiab 11.

Kauj Ruam 7: Txuas xov tooj ntawm LCD

Kev teeb tsa lub LCD Saib
Kev teeb tsa lub LCD Saib

Txog qhov haujlwm no, LCD zaub yuav ua haujlwm hloov pauv tus lej binary rau hauv zauv. Thaum peb saib ntawm lub vijtsam LCD, koj yuav pom 4 tus txiv neej tus pin. Cov pins yog VCC, GND, SDA thiab SCL. Rau VCC, siv tus txiv neej rau poj niam xaim txuas VCC tus pin mus rau txoj kev tsheb nqaj hlau ntawm lub khob cij. Qhov no yuav muab 5 volts rau VCC tus pin Rau tus pin GND, txuas nws mus rau hauv av tsheb nqaj hlau nrog txiv neej rau poj niam xaim. Nrog SDA thiab SCL tus pin, txuas nws mus rau tus pin piv nrog txiv neej rau poj niam xaim. Kuv txuas SCL tus pin rau tus pin analog A5 thiab SDA tus pin rau analog pin A4.

Kauj Ruam 8: Sau Txoj Cai

Tam sim no uas kuv tau piav qhia lub tsev ib feem ntawm txoj haujlwm no, cia tam sim no pib qhov chaws. Ua ntej tshaj, peb yuav tsum xub rub tawm thiab ntshuam cov tsev qiv ntawv hauv qab no; LiquidCrystal_I2C lub tsev qiv ntawv, thiab lub tsev qiv ntawv xaim.

#ncig #ncig

Thaum koj tau ua tiav qhov no, koj yuav tsum tshaj tawm txhua qhov kev hloov pauv tsim nyog. Hauv txhua hom kev cai, koj yuav tsum tshaj tawm koj cov kev hloov ua ntej.

const cov lej 1 = 2;

const cov lej 2 = 3;

const cov lej 3 = 4;

const cov lej 4 = 5;

const cov lej 5 = 6;

int digitsum1 = 0;

int digitsum2 = 0;

int digitsum3 = 0;

int digitsum4 = 0;

int digitsum5 = 0;

char array1 = "Binary to Decimal";

char array2 = "Converter";

int sij = 500; // tus nqi ncua sijhawm

const int redPin = 9;

const int greenPin = 10;

const int bluePin = 11;

#define COMMON_ANODE

LiquidCrystal_I2C lcd (0x27, 16, 2);

Hauv qhov tsis muaj teeb tsa teeb tsa (), koj tshaj tawm tus pin hom rau txhua qhov koj hloov pauv. Koj tseem yuav siv qhov pib ua ntu zus vim tias peb siv analogWrite ()

void teeb tsa ()

{

Serial.begin (9600);

pinMode (tus lej 1, INPUT);

pinMode (tus lej 2, INPUT);

pinMode (tus lej 3, INPUT);

pinMode (tus lej 4, INPUT);

pinMode (tus lej 5, INPUT);

lcd.init ();

lcd.backlight ();

pinMode (redPin, OUTPUT);

tus pinMode (greenPin, OUTPUT);

tus pinMode (bluePin, OUTPUT);

Hauv qhov tsis muaj teeb tsa teeb tsa (), Kuv tsim lub voj rau tsim cov lus hais lub npe ntawm txoj haujlwm no. Qhov laj thawj yog vim li cas nws tsis nyob hauv lub voj void () yog tias yog nws nyob hauv qhov khoob ntawd, cov lus yuav rov ua dua

lcd.setCursor (15, 0); // teeb tus cursor rau kab 15, kab 0

rau (int positionCounter1 = 0; positionCounter1 <17; positionCounter1 ++)

{

lcd.scrollDisplayLeft (); // Scrolls tus txheem ntawm cov zaub ib qhov chaw mus rau sab laug.

lcd.print (array1 [positionCounter1]); // Luam tawm cov lus rau LCD.

ncua (tim); // tos 250 microseconds

}

lcd.clear (); // Tshem tawm lub vijtsam LCD thiab tso tus cursor nyob rau kaum kaum sab saud.

lcd.setCursor (15, 1); // teeb tus cursor rau kab 15, kab 1

rau (int positionCounter = 0; positionCounter <9; positionCounter ++)

{

lcd.scrollDisplayLeft (); // Scrolls tus txheem ntawm cov zaub ib qhov chaw mus rau sab laug.

lcd.print (array2 [positionCounter]); // Sau cov lus rau LCD.

ncua (sijhawm); // tos 250 microseconds

}

lcd.clear (); // Tshem tawm lub vijtsam LCD thiab tso tus cursor nyob rau kaum kaum sab saud.

}

Tam sim no peb tau ua tiav qhov tsis muaj teeb tsa teeb tsa (), cia peb txav mus rau qhov khoob khoob (). Hauv lub voj void, Kuv tau tsim ob peb yog-lwm cov nqe lus kom ntseeg tau tias thaum qee lub teeb qhib lossis tawm, nws yuav tso tawm qee tus lej zauv ntawm cov zaub. Kuv tau txuas ib daim ntawv qhia pom dab tsi hauv kuv lub voj void thiab ntau lwm qhov voids kuv tau tsim. Nyem qhov no mus xyuas daim ntawv

Tam sim no txhua yam koj yuav tsum tau ua yog ua raws txoj cai thiab txaus siab rau koj lub binary tshiab rau decimal converter.

Pom zoo: