fbpx
วิกิพีเดีย

รหัสตัวเลข

รหัสตัวเลข (อังกฤษ: numeric code)

แยกออกเป็นหัวข้อย่อย ๆ ได้ ดังนี้ 1. Number systems แบ่งออกเป็นเลขฐานต่าง ๆ ดังนี้ 1.1 เลขฐาน 2 ( Binary Number System ) ประกอบด้วยตัวเลข 0 และ 1 ระบบเลขฐานสอง มีสัญลักษณ์ที่ใช้เพียงสองตัว คือ 0 และ 1 และการคำนวณตัวเลขใน เลขฐานสองมีการคำนวณ ดังตัวอย่าง ตัวอย่าง เช่น 1101 = (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20) (0.1011)2 = (1 x 2- 1) + (0 x 2- 2) + (1 x 2- 3) + (1 x 2- 4)

1.2 เลขฐาน 8 ( Octal Number System ) ประกอบด้วยตัวเลข 0 – 7 1.3 เลขฐาน 10 ( Decimal Number System ) ประกอบด้วยตัวเลข 0 – 9 ระบบเลขฐานสิบ เป็นระบบเลขที่ใช้กันในชีวิตประจำวัน ไม่ว่าจะนำไปใช้คำนวณประเภท ใดโดยจะมีสัญลักษณ์ที่ใช้แทนตัวเลขต่างๆ ของเลขฐานสิบ จำนวน 10 ตัว ได้แก่ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 และการคำนวณตัวเลขในเลขฐานสิบมีการคำนวณ ดังตัวอย่าง ตัวอย่าง เช่น 456.395 = 4 x 102 + 5 x 101 + 6 x 100 + 3 x 10- 1 + 9 x 10- 2 + 5 x 10- 3

1.4 เลขฐาน 16 ( Hexadecimal Number System ) ประกอบด้วยตัวเลข 0 – 9 และA – F

การแปลงเลขฐาน แปลงเลขฐานสองเป็นฐานสิบ การแปลงเลขฐานสองให้เป็นเลขฐานสิบทำได้โดยการที่เรานำเลขฐานสองไปยกกำลังด้วยตำแหน่งของตัวเลข ดังตัวอย่าง ตัวอย่าง เช่น (110111)2 มีค่าเท่ากับเท่าไรในระบบเลขฐานสิบ วิธีทำ (110111)2 = 1 x 25 + 1 x 24 + 0 x 23 + 1 x 22 + 1 x 21 + 1 x 20 = 32 + 16 + 0 +4 + 2 + 1 1101112 = 5510

การแปลงเลขฐานสิบเป็นฐานสอง การแปลงเลขฐานสิบเป็นฐานสองทำได้หลายวิธีแต่ที่จะนำมาให้ดู คือ การนำมาหารสั้นโดยนำเลขฐานสิบมาหารด้วยเลข 2 แล้วเก็บค่าเศษไว้จนไม่สามารถหารต่อได้แล้ว จากนั้นก็นำเศษที่เก็บไว้นั้นมาเรียงจากเศษที่ได้ตัวสุดท้ายไปจนถึงตัวแรก การแปลงเลขฐาน 10 เป็นฐาน 8 และฐาน 16 การแปลงเลขฐาน 10 เป็นเลขฐาน 8 และ เลขฐาน 16 มีลักษณะเดียวกับการแปลงเป็นเลขฐาน 2 โดยใช้ค่าฐานไปหารเพื่อหาเศษbin ดังตัวอย่าง ตัวอย่าง เช่น ฐาน 10 เป็น ฐาน 8 295 = 295 / 8 ได้ 36 เหลือเศษ 7 แล้วเอา 36 / 8 ได้ 4 เหลือเศษ 6 แล้วเอา 4 / 8 ซึ่งมาสามารถหารได้ เหลือเศษ 4 ดังนั้น 295 = 4678

ฐาน 10 เป็น ฐาน 16 295 = 295 / 16 ได้ 18 เหลือเศษ 7 แล้วเอา 18 / 16 ได้ 1 เหลือเศษ 2 แล้วเอา 1 / 16 ซึ่งมาสามารถหารได้ เหลือเศษ 1 ดังนั้น 295 = 12716

2. Conversion

3. Arithmetic คือ ส่วนประกอบหลักส่วนหนึ่งของไมโครโปรเซสเซอร์เป็นวงจรลอจิกที่ใช้ประมวลผลข้อมูลหรือ หน่วยคำนวณตรรกะ ทำหน้าที่คำนวณและดำเนินการเปรียบเทียบ เป็นหน่วยหลักของการประมวลผล ข้อมูลจะถูกส่งออกจากส่วนเก็บแล้วส่งไปยัง ALU ซ้ำไปมาหลายครั้งจนประมวลผลเสร็จ ส่วนที่ทำหน้าที่เก็บความจำระหว่างการประมวลผลของ ALUเรียกว่า เรจิสเตอร์ ( Register ) ส่วนที่เก็บผลลัพธ์จาก ALU คือ Accumulater Register เมื่อผู้ใช้ป้อนข้อมูลในระบบฐานสิบเข้าไปในเครื่องและสั่งให้ปฏิบัติการ ข้อมูลจะถูกเปลี่ยนไปเก็บไว้ในระบบเลขฐาน 2 โดยที่จำนวนเต็มบวก และทศนิยม Sign – Magnitude ส่วนจำนวนเต็มลบจะเก็บแบบ 2’s Complement จากนั้นจะทำการบวก ลบ คูณ หาร และให้ผลลัพธ์ ออกมาเป็นระบบฐาน 10


4. Binary coded decimal BCD เป็นรหัสข้อมูลที่ประกอบด้วยเลขฐานสอง 6 บิต แทนข้อมูล 1 อักขระ (1 Character) จึงสามารถสร้างรหัสข้อมูลได้จำนวน 26 = 64 รหัส รหัสทั้ง 6 บิต แบ่งได้เป็น 2 กลุ่ม โดย 2 บิตแรกเรียกว่า Zone Bit และ 4 บิตถัดไปเรียกว่า Numeric Bit

5. Gray code รหัส Gray codeใช้ตัวเลขฐานสองจำนวน 4 บิท เช่นเดียวกับรหัส BCD , Excess-3, 4221 BCD code และปกติจะใช้แทนตัวเลขฐานสิบ ตั้งแต่ 0-9 แต่เราอาจจะเขียนรหัส Gray แทนเลขฐานสิบได้ตั้งแต่ 0-15 หลักการของ Gray code ตัวเลขที่อยู่ติดกันในลำดับ จะมีค่าต่างกัน เพียง 1 บิทเท่านั้น จากตารางข้างล่างนี้ เป็นการเทียบ 4-bit binary code กับ 4-bit Gray code การเปลี่ยน Gray Code เป็น Binary Code ตัวอย่าง เช่น แปลง 1010GRAY เป็น binary

การเปลี่ยน Binary Code เป็น Gray Code ตัวอย่าง เช่น แปลง 11002 เป็น Gray code


6. Fixed-point number เป็นค่าทศนิยมที่กำหนดตำแหน่งแน่นอน โดยไม่สนใจตำแหน่งที่อยู่ถัดไป มีค่าความผิดพลาด (Error) สูง ไม่เป็นที่นิยมใช้ในการคำนวณทางวิทยาศาสตร์ที่ต้องการความละเอียดสูง

7. Floating-point numbers

เป็นค่าทศนิยมที่มีการประมาณค่าตำแหน่งที่ต้องการโดยคำนึงตำแหน่งที่อยู่ถัดไปก่อนที่จะตัดทิ้ง โดยอาจจะทำการปัดเศษ (Rouding) ทำให้มีค่าผิดพลาดน้อยและน่าเชื่อถือมาก จึงนิยมใช้ในทางวิทยาศาสตร์

รห, สต, วเลข, บทความน, อาจต, องเข, ยนใหม, งหมดเพ, อให, เป, นไปตามมาตรฐานค, ณภาพของว, เด, หร, อกำล, งดำเน, นการอย, ณช, วยเราได, หน, าอภ, ปรายอาจม, อเสนอแนะ, งกฤษ, numeric, code, แยกออกเป, นห, วข, อย, อย, ได, งน, number, systems, แบ, งออกเป, นเลขฐานต, าง, งน, เล. bthkhwamnixactxngekhiynihmthnghmdephuxihepniptammatrthankhunphaphkhxngwikiphiediy hruxkalngdaeninkarxyu khunchwyeraid hnaxphiprayxacmikhxesnxaenarhstwelkh xngkvs numeric code aeykxxkepnhwkhxyxy id dngni 1 Number systems aebngxxkepnelkhthantang dngni 1 1 elkhthan 2 Binary Number System prakxbdwytwelkh 0 aela 1 rabbelkhthansxng misylksnthiichephiyngsxngtw khux 0 aela 1 aelakarkhanwntwelkhin elkhthansxngmikarkhanwn dngtwxyang twxyang echn 1101 1 x 23 1 x 22 0 x 21 1 x 20 0 1011 2 1 x 2 1 0 x 2 2 1 x 2 3 1 x 2 4 1 2 elkhthan 8 Octal Number System prakxbdwytwelkh 0 7 1 3 elkhthan 10 Decimal Number System prakxbdwytwelkh 0 9 rabbelkhthansib epnrabbelkhthiichkninchiwitpracawn imwacanaipichkhanwnpraephth idodycamisylksnthiichaethntwelkhtang khxngelkhthansib canwn 10 tw idaek 0 1 2 3 4 5 6 7 8 9 aelakarkhanwntwelkhinelkhthansibmikarkhanwn dngtwxyang twxyang echn 456 395 4 x 102 5 x 101 6 x 100 3 x 10 1 9 x 10 2 5 x 10 31 4 elkhthan 16 Hexadecimal Number System prakxbdwytwelkh 0 9 aelaA Fkaraeplngelkhthan aeplngelkhthansxngepnthansib karaeplngelkhthansxngihepnelkhthansibthaidodykarthieranaelkhthansxngipykkalngdwytaaehnngkhxngtwelkh dngtwxyang twxyang echn 110111 2 mikhaethakbethairinrabbelkhthansib withitha 110111 2 1 x 25 1 x 24 0 x 23 1 x 22 1 x 21 1 x 20 32 16 0 4 2 1 1101112 5510karaeplngelkhthansibepnthansxng karaeplngelkhthansibepnthansxngthaidhlaywithiaetthicanamaihdu khux karnamaharsnodynaelkhthansibmahardwyelkh 2 aelwekbkhaessiwcnimsamarthhartxidaelw caknnknaessthiekbiwnnmaeriyngcakessthiidtwsudthayipcnthungtwaerk karaeplngelkhthan 10 epnthan 8 aelathan 16 karaeplngelkhthan 10 epnelkhthan 8 aela elkhthan 16 milksnaediywkbkaraeplngepnelkhthan 2 odyichkhathanipharephuxhaessbin dngtwxyang twxyang echn than 10 epn than 8 295 295 8 id 36 ehluxess 7 aelwexa 36 8 id 4 ehluxess 6 aelwexa 4 8 sungmasamarthharid ehluxess 4 dngnn 295 4678than 10 epn than 16 295 295 16 id 18 ehluxess 7 aelwexa 18 16 id 1 ehluxess 2 aelwexa 1 16 sungmasamarthharid ehluxess 1 dngnn 295 127162 Conversion3 Arithmetic khux swnprakxbhlkswnhnungkhxngimokhropressesxrepnwngcrlxcikthiichpramwlphlkhxmulhrux hnwykhanwntrrka thahnathikhanwnaeladaeninkarepriybethiyb epnhnwyhlkkhxngkarpramwlphl khxmulcathuksngxxkcakswnekbaelwsngipyng ALU saipmahlaykhrngcnpramwlphlesrc swnthithahnathiekbkhwamcarahwangkarpramwlphlkhxng ALUeriykwa ercisetxr Register swnthiekbphllphthcak ALU khux Accumulater Register emuxphuichpxnkhxmulinrabbthansibekhaipinekhruxngaelasngihptibtikar khxmulcathukepliynipekbiwinrabbelkhthan 2 odythicanwnetmbwk aelathsniym Sign Magnitude swncanwnetmlbcaekbaebb 2 s Complement caknncathakarbwk lb khun har aelaihphllphth xxkmaepnrabbthan 104 Binary coded decimal BCD epnrhskhxmulthiprakxbdwyelkhthansxng 6 bit aethnkhxmul 1 xkkhra 1 Character cungsamarthsrangrhskhxmulidcanwn 26 64 rhs rhsthng 6 bit aebngidepn 2 klum ody 2 bitaerkeriykwa Zone Bit aela 4 bitthdiperiykwa Numeric Bit5 Gray code rhs Gray codeichtwelkhthansxngcanwn 4 bith echnediywkbrhs BCD Excess 3 4221 BCD code aelapkticaichaethntwelkhthansib tngaet 0 9 aeteraxaccaekhiynrhs Gray aethnelkhthansibidtngaet 0 15 hlkkarkhxng Gray code twelkhthixyutidkninladb camikhatangkn ephiyng 1 bithethann caktarangkhanglangni epnkarethiyb 4 bit binary code kb 4 bit Gray code karepliyn Gray Code epn Binary Code twxyang echn aeplng 1010GRAY epn binarykarepliyn Binary Code epn Gray Code twxyang echn aeplng 11002 epn Gray code6 Fixed point number epnkhathsniymthikahndtaaehnngaennxn odyimsnictaaehnngthixyuthdip mikhakhwamphidphlad Error sung imepnthiniymichinkarkhanwnthangwithyasastrthitxngkarkhwamlaexiydsung7 Floating point numbersepnkhathsniymthimikarpramankhataaehnngthitxngkarodykhanungtaaehnngthixyuthdipkxnthicatdthing odyxaccathakarpdess Rouding thaihmikhaphidphladnxyaelanaechuxthuxmak cungniymichinthangwithyasastr ekhathungcak https th wikipedia org w index php title rhstwelkh amp oldid 7200472, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม