Computer Science

Numeral Systems

Numeral systems are methods of representing numbers using symbols. In computer science, the most commonly used numeral systems are binary (base-2), decimal (base-10), and hexadecimal (base-16). Binary is fundamental in digital systems, representing data using only two symbols (0 and 1). Decimal is the standard system for human use, while hexadecimal is widely used in computing for its compact representation of binary data.

Written by Perlego with AI-assistance

7 Key excerpts on "Numeral Systems"

Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.
  • Microprocessor and Microcontroller Interview Questions:: A complete question bank with real-time examples
    HAPTER 1

    Number Systems

    Introduction to Number systems

    Number systems are used to reparesent the information in various systems. Electronic and Digital systems may use a variety of different number systems, (Decimal, Hexadecimal, Octal, Binary).
    A number N in base or radix b can be written as:
    (N)b = dn-1 dn-2 — — — — d1 d0 . d-1 d-2 — — — — d-m
    In the above:
    • dn-1 to d0 is integer part
    follows a radix point
    • d-1 to d-m is fractional part.
    Here:
    • dn-1 =
      Most significant bit (MSB)
    • d-m
      = Least significant bit (LSB)
    Number Systems
    S. No. Parameters Binary Octal Decimal Hexadecimal
    1 Base 2 8 10 16
    2 Symbol/Digits 0 & 1 0 – 7 0 – 9 0– 9 & A – F

    Binary number system

    The binary number system is another way to represent quantities. The binary number has only two digits 0 and 1. Weight structure of a binary system is:
    2n-1 ……….23 22 21 20 . 2-1 2-2 2-3 ……. 2-n
    Where:
    • n: The number of bits from the binary point
    • .: Binary point
    • 2: Base of binary number system.
    Example: (11011)2

    Octal number system

    The number system whose base is 8 is known as the octal number system . The base 8 means the system uses eight digits from 0 to 7. The next digit in octal number is represented by 10, 11, 12, 13, 14, 15, 16, 17 which represents the decimal digits 8, 9, 10, 11, 12, 13, 14, 15.
    Weight structure of an octal system is:
    8n-1 ……….83 82 81 80 . 8-1 8-2 8-3 …….. 8-n
    Where:
    • n: positional of octal number system
    • . : Octal point
    • 8: Base of octal number system.
    Example: (745)8

    Decimal number system

    The number system whose base is 10 is known as the decimal number system . The base 10 means the system uses ten digits from 0 to 9.
    Weight structure of a decimal system is:
    10n-1 …………103 102 101 1030 . 10-1 10-2 10-3 …….. 10-n
    Where:
    • n: positional of Decimal number system
    • . :
  • Programmable Logic Controllers
    • William Bolton(Author)
    • 2011(Publication Date)
    • Newnes
      (Publisher)
    3 Number systems
    The number system used for everyday calculations is the denary or decimal system. This is based on the use of the 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. With a number represented by this system, the digit position in the number indicates the weight attached to each digit, the weight increasing by a factor of 10 as we proceed from right to left. Hence we have:
    Counting can, however, be done to any base. The denary system is just convenient because we have ten fingers. If we had only two then our system for everyday counting would probably have been different. Computers, and hence PLC systems, are based on counting in twos because it is convenient for their system, their two digits being effectively just the off and on signals. When working with PLCs, other base number systems are also used, e.g. input and output addresses are often specified using the octal system, i.e. base 8.

    3.1 The binary system

    The binary system is based on just two digits: 0 and 1. These are termed binary digits or bits. When a number is represented by this system, the digit position in the number indicates the weight attached to each digit, the weight increasing by a factor of 2 as we proceed from right to left.
    The bit 0 is termed the least significant bit (LSB) and the highest bit the most significant bit (MSB). For example, with the binary number 1010, the least significant bit is the bit at the right-hand end of the number and so is 0. The most significant bit is the bit at the left-hand end of the number and so is 1.
    When converted to a denary number we have, for the 1010: Thus the denary equivalent is 10. The conversion of a binary number to a denary number thus involves the addition of the powers of 2 indicated by the number.
    The conversion of a denary number to a binary number involves looking for the appropriate powers of 2. We can do this by successive divisions by 2, noting the remainders at each division. Thus with the denary number 31:
    The binary number is 11111. The first division gives the least significant bit because we have just divided the 31 by 2, i.e. 21 and found 1 left over for the 2° digit. The last division gives the most significant bit because the 31 has then been divided by 2 four times, i.e. 24
  • Artificial Intelligence
    eBook - ePub

    Artificial Intelligence

    A Philosophical Introduction

    meaning of a symbol out of the meanings of its components. Taken together, recursive structure and compositionality give a binary symbolic code the power to represent an endless variety of information about the world.

    Representing numbers

    Most of the initial interest in computers centred on their ability to do mathematics and it is largely because of this that the bits came to be written universally as ‘0’ and ‘1’. In the early days of AI, researchers found it was an uphill struggle to dispel the prevailing image of computers as ‘mere number crunchers’, and they had to lay stress on the fact that bit strings can be used to represent anything at all, not just numbers. It is with similar intentions that I have left the issue of numerical representation until last.
    At school, we are all taught to do arithmetic in the so-called base 10 system. In the base 10 counting system there are ten ‘unstructured’ or ‘primitive’ symbols, ‘0’ through to ‘9’. Every other number-symbol is a compositional compound of these. There is nothing sacrosanct about the base 10 system. Tradition might equally well have steered us into the base 12 system, where there are twelve primitive symbols: ‘0’ through to ‘9’, plus two extra ones, perhaps # for 10 and ≈ for 11. In base 12, compound symbols start at twelve rather than ten.
    Figure 4.3 Think of each binary digit as pointing to a box.
    Modern computers do arithmetic in base 2 (although some older machines, for example the ENIAC, used base 10). Base 2 is also known as the binary number system. In base 2 there are two primitive symbols, and compounding starts at the number two. Here are some symbols from the base 2 system, together with the numbers that they represent.
    Binary numbers
    0zero110six
    1one111seven
    10two1000eight
    11three1001nine
    100four1010ten
    101five
    The way to convert from binary to base 10 is to think of each bit in the string as pointing to a box (fig. 4.3 ). The box on the far right of a row always contains either nought or 1. Working left, the next box always contains either nought or 2. The third box along will contain either nought or 22 , and the fourth, nought or 23 . If there is a fifth it contains either nought or 24 , and so on for as many bits as there are in the string. If a box has a 0 pointing to it, this means it contains the first of the two options, nought. If it has a 1 pointing to it, then it contains the other option. Figure 4.4
  • Programmable Logic Controllers
    • William Bolton(Author)
    • 2015(Publication Date)
    • Newnes
      (Publisher)
    Chapter 3

    Digital Systems

    Abstract

    In this chapter the various number systems are looked at, namely denary, binary, octal, hexadecimal and binary coded decimal. Binary arithmetic is developed. Combinational and sequential logic systems are introduced.
    Keywords Denary binary octal hexadecimal and binary coded decimal number systems logic systems
    Digital systems work with inputs, which are essentially just off/on signals, with the two signal levels represented by 0 and 1. These are termed binary digits . The number system used for everyday calculations is the denary or decimal system . This is based on the use of 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. With a number represented by this system, the digit position in the number indicates the weight attached to each digit, the weight increasing by a factor of 10 as we proceed from right to left. Hence we have:
    103 102 101 100
    ThousandsHundredsTensUnits
    Denary1000100101
    Thus if we have the denary number 1234, we have 1 with a place value of 103 , 2 with a place value of 102 , 3 with a place value of 101 , and 4 with a place value of 100 . Counting can, however, be done to any base. The denary system is convenient mainly because we have 10 fingers. If we had only two fingers, our system for everyday counting would probably have been different. Computers, and hence PLC systems, are based on counting in twos because it is convenient for their systems, their two digits being effectively just the off and on signals. When working with PLCs, other base number systems are also used; for example, input and output addresses are often specified using the octal system, that is, base 8. However, the PLC itself works with binary numbers. In this chapter we take a look at the various number systems.
    We also take an introductory look at logic systems . A Combinational logic systems take binary inputs and combine them to give a binary output. The relationship between the inputs and the output can be described by truth tables . With such systems, the output of a particular combination of inputs is determined only by their state at the instant of time concerned. However, with sequential logic systems
  • Programmable Logic Controllers
    • William Bolton(Author)
    • 2009(Publication Date)
    • Newnes
      (Publisher)
    Chapter 3. Digital Systems
    Digital systems work with inputs, which are essentially just off/on signals, with the two signal levels represented by 0 and 1. These are termed binary digits. The number system used for everyday calculations is the denary or decimal system. This is based on the use of the 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. With a number represented by this system, the digit position in the number indicates the weight attached to each digit, the weight increasing by a factor of 10 as we proceed from right to left. Hence we have:
    103 102 101 100
    ThousandsHundredsTensUnits
    Denary1000100101
    Thus if we have the denary number 1234, we have 1 with a place value of 103 , 2 with a place value of 102 , 3 with a place value of 101 , and 4 with a place value of 100 . Counting can, however, be done to any base. The denary system is convenient mainly because we have 10 fingers. If we had only two fingers, our system for everyday counting would probably have been different. Computers, and hence PLC systems, are based on counting in twos because it is convenient for their systems, their two digits being effectively just the off and on signals. When working with PLCs, other base number systems are also used; for example, input and output addresses are often specified using the octal system, that is, base 8. However, the PLC itself works with binary numbers. In this chapter we take a look at the various number systems.
    We also take an introductory look at logic systems. With combinational logic systems, these take binary inputs and combine them to give a binary output. The relationship between the inputs and the output can be described by truth tables. With such systems, the output of a particular combination of inputs is determined only by their state at the instant of time concerned. However, with sequential logic systems
  • Microprocessor Technology
    • J S Anderson(Author)
    • 2012(Publication Date)
    • Routledge
      (Publisher)
    Chapter 2

    Binary maths and number systems

    The decimal system

    The decimal system is so called because there are ten digits available, 0 to 9. All other numbers in the system are made up of combinations of these. (Dec means 10 as in decade – 10 years, December – 10th month (July and August have been added) and decathlon – 10 events, etc.) A number like 255 really means:
    100s10sUnits
    255
    We can recognise 255 instantly because we are used to using decimal numbers, but in the binary system, 255 would be written as: 1111 1111. This is not so recognisable (unless we are used to it) although we could easily work it out. Similarly, we could work out the value of 255:
    In ‘index’ notation (powers of 10) the column headings are:
    103 102 101 100
    (1000s)(100s)(10s)(Units)
    4527
    i.e.
    (Remember, incidentally, that x0 = 1, whatever the value of x.)
    Table 2.1 Decimal numbers 0 to 64 with their binary equivalents. Note how the convention of writing the numbers in groups of four is adhered to. (They're easier to read like this and each group of four can be represented by a single hexadecimal digit as we shall see later.) Frequently, the leading zeros are also written down, e.g. 62D would be written as 0011 1110. This is how it would appear in a CPU register or memory location
    Decimal    Binary Decimal Binary
      0            0 33   10 0001
      1            1 34   10 0010
      2          10 35   10 0011
      3          11 36   10 0100
      4        100 37   10 0101
      5        101 38   10 0110
      6        110 39   10 0111
      7        111 40   10 1000
      8      1000 41   10 1001
      9      1001 42   10 1010
    10      1010 43   10 1011
    11      1011 44   10 1100
    12      1100 45   10 1101
    13      1101 46   10 1110
    14      1110 47   10 1111
    15      1111 48   11 0000
    16   1 0000
  • Understanding Primary Mathematics
    To count some objects in any of these systems you recite the number names in order whilst pointing to each object in turn. The number of the final object is the total number of objects.
    This is called the cardinal property of numbers.
    Numbers can also be used to indicate position as in 1st, 2nd, 3rd… this is the ordinal property of numbers.

    PLACE VALUE

    The Mayan system substantially reduced the number of symbols needed by giving a different value to a symbol in a changed position. Mayans wrote their numbers vertically. When the symbol for one is moved up, it means 20.
    So the number shown in Figure 1a is 25.
    The Mayans also had a symbol for zero which tells you that the position is empty. The dot is now in the upper, or second position, as in Figure 1b , and has a value of 20.
    Figure 1a
    Figure 1b
    The Hindu-Arabic number system was developed in India and adopted and spread by the Arabs. It uses ten symbols. These are 1, 2, 3, 4, 5, 6, 7, 8 and 9, known as digits, which, when written singly, are the first nine natural or counting numbers, and 0, a symbol for zero, which acts as a place holder. The next number is formed by moving the symbol for one along to the left and inserting the symbol for zero. This gives the number 10 meaning one ten and no units.
    Two-digit numbers form a regular pattern of numbers 11, 12, 13,…, 19, 20, 21,…, 98, 99 up to nine tens and nine ones or units. The words for the numbers are not completely regular in some of the European languages, including English, although they are regular in many far Eastern languages, i.e. Chinese, Japanese and Korean. Some of the difficulties our children encounter are:
    13 ten and three thirteen three and ten Syllables of the word are in opposite order to the digits for thirteen to nineteen
    20 two tens twenty Right order but two is distorted to twen-Three is thir- in 30 and five is fif- in 50
    60 six tens sixty Sixty is clear So are seventy, eighty and ninety
    It is not unusual to see young children write thirteen as 31, having heard ‘thir’ and written that first. The error arises in trying to make sense of the system.