3.4 : පරිගණකයෙහි ලකුණුවත් සංඛ්‍යා නිරූපණය - 1 කොටස - උසස්පෙළ තොරතුරු හා සන්නිවේදන තාක්ෂණය

3.4 : පරිගණකයෙහි ලකුණුවත් සංඛ්‍යා නිරූපණය - 1 කොටස

පරිගණකයෙහි දත්ත නිරූපනය (Data representation of a computer)

වර්තමාන පරිගණක වල ඉලක්කම් / අක්ෂරයන් නිරූපනය වන්නේ බිටු 64 ( 64 bits) කිනි. මෙසේ බිටු 64 ක් වන විට මධ්‍ය සැකසුම් ඒකකය විසින් ප්‍රධාන මතකයෙන් (Main Memory) සැකසීම සඳහා වරකට ලබා ගන්නා දත්ත ප්‍රමාණය 264 වේ. මෙය ඉතාම විශාල අගයක් වේ. අතීතයේ දී පරිගණක වල බිටු 16 සහ 32 යන ප්‍රමාණ භාවිතා කළ අතර වර්තමානයේ කාර්යයන්ට සරිලන පරිදි මෙය ප්‍රමාණවත් නොවීය. එබැවින් බිටු 16 සහ 32 භාවිතයෙන් ඉවතට යමින් පවතියි. පරිගණකයේ පූර්ණ සංඛ්‍යාවක් නිරූපනය කළ හැකි ප්‍රධාන ආකාර 2 කි. එනම්,

01. ලකුණු නොලත් නිඛිල සංඛ්‍යා (Unsigned Integers)
02. ලකුණුවත් නිඛිල සංඛ්‍යා (Signed Integers)

Unsigned Integers (ලකුණු නොලත් නිඛිල සංඛ්‍යා)

ධන පූර්ණ සංඛ්‍යා පමණක් අඩංගු වේ. මෙහිදී ඉලක්කමක් හෝ අනුලක්ෂණයක් බිටු 8 (8 bits) කින් නිරූපනය කරන්නේ නම් එහි
( 28-1 )ප්‍රමාණයක් පූර්ණ ධන සංඛ්‍යා ඇත.


00000000
11111111

Signed Integers (ලකුණුවත් නිඛිල සංඛ්‍යා)

ධන සහ සෘණ යන ආකාර දෙකෙන්ම පූර්ණ සංඛ්‍යාවක් දැක්වේ. මෙහි ආකාර 3 කි. එනම්,

                                                       01. Sign Magnitude Representation
                                                       02. 1’s Complement Representation
                                                       03. 2’s Complement Representation

වැඩිම වෙසෙසි බිටුව සහ අඩුම වෙසෙසි බිටුව (Most Significant Digit & Least Significant Digit)

වැඩිම වෙසෙසි බිටුව (MSD / MSB) යනු සංඛ්‍යාවක වැඩිම ස්ථානීය අගය ඇති අංකය හෝ බිටුවයි. අඩුම වෙසෙසි බිටුව (LSD / LSB) යනු සංඛ්‍යාවක අඩුම ස්ථානීය අගය ඇති අංකයයි හෝ බිටුවයි.

111111010101010

අඩුම වෙසෙසි බිටුව (LSD - Least Significant Digit / LSB - Least Significant Bit) = 0
වැඩිම වෙසෙසි බිටුව (MSD - Most Significant Digit / MSB - Most Significant Bit) = 1

In computing, the most significant bit (MSB, also called the high-order bit) is the bit position in a binary number having the greatest value. The MSB is sometimes referred to as the left-most bit due to the convention in positional notation of writing more significant digits further to the left. The MSB can also correspond to the sign bit of a signed binary number in one's or two's complement notation, "1" meaning negative and "0" meaning positive. (Source : wikipedia)

In computing, the least significant bit (LSB) is the bit position in a binary integer giving the units value, that is, determining whether the number is even or odd. The LSB is sometimes referred to as the right-most bit, due to the convention in positional notation of writing less significant digits further to the right. It is analogous to the least significant digit of a decimal integer, which is the digit in the ones (right-most) position. (Source : Wikipedia)



ලකුණු බිටුව (Sign Bit)

පහත බිටු 8 හි රෙජිස්ටරය (Register) සලකා බලමු. මෙහි වැඩිම වෙසෙසි බිටුව (Most Significant Digit - MSD) මගින් නිරූපණය කරනු ලබන සංඛ්‍යාංකය මගින් සංඛ්‍යාවේ + / - ලකුණ තීරණය වේ. මෙම බිටුව ලකුණු බිටුව (Sign Bit) ලෙස හැඳින්වේ. මෙම බිටුවෙහි අගය 0 නම් සංඛ්‍යාව + (ධන ) සංඛ්‍යාවක් ද අගය 1 නම් සංඛ්‍යාව - (සෘණ ) සංඛ්‍යාවක් ද නිරූපනය වේ.

Sign Bit 0 -> + (ධන) සංඛ්‍යාවක්
Sign Bit 1 -> - (සෘණ) සංඛ්‍යාවක්

Sign Bit
උදා: +7 නිරූපනය


00000111

ඉහත උදාහරණයේ තද කළු වර්ණයෙන් සටහන් කර ඇති වැඩිම වෙසෙසි බිටුව (Most Significant Bit) ලකුණු බිටුව (Sign Bit) වේ. එය 0 නිසා සංඛ්‍යාව ධන සංඛ්‍යාව (Positive number) කි.

උදා:  -7 නිරූපනය

11111000

ඉහත උදාහරණයේ තද කළු වර්ණයෙන් සටහන් කර ඇති වැඩිම වෙසෙසි බිටුව (Most Significant Bit) ලකුණු බිටුව (Sign Bit) වේ. එය 1 නිසා සංඛ්‍යාව සෘණ සංඛ්‍යාව (Negative number) කි.

ඉහත උදාහරණයේ ලකුණු බිටුවෙහි (Sign Bit) වෙනස් වීම අනුව සංඛ්‍යාවක + / - ලකුණ වෙනස් වන බව දැකගත හැකිවේ.

 

තවත් කොටසක් බලාපොරොත්තු වන්න.