Computer Science

Binary Number System

The binary number system is a base-2 numeral system used in computers, which represents numbers using only two digits: 0 and 1. In this system, each digit's place value is a power of 2, making it well-suited for electronic systems that use on/off states to represent data. Binary numbers are fundamental to digital computing and are used in various computer operations and programming languages.

Written by Perlego with AI-assistance

10 Key excerpts on "Binary Number System"

  • Book cover image for: Foundations of Digital Logic Design
    • Gideon Langholz, Abraham Kandel;Joe L Mott;;(Authors)
    • 1998(Publication Date)
    • WSPC
      (Publisher)
    2 Number Systems, Arithmetic Operations and Codes 2.1 INTRODUCTION Digital systems are characterized by signals restricted to two possible values which are represented by an alphabet of only two characters, commonly denoted by 0 and 1. Binary data representations are therefore of fundamental importance to the analysis and design of digital systems. We begin this chapter by considering numerical data representations. Working with digital systems usually requires familiarity with several number systems: Decimal Binary Octal Hexadecimal Binary-coded decimal (BCD) The Binary Number System is the most natural to use in a digital system. Sometimes, however, it is more convenient to employ the other number systems, in particular the familiar decimal number system. In such cases, the numbers are manipulated within the number system in use but are, nevertheless, represented as binary numbers within the digital system. We will introduce arithmetic operations to provide a basis for understanding how digital systems handle numbers in arithmetic computations. We will discuss unsigned and signed binary number representations and consider the four basic arithmetic operations: 21 22 CHAPTER 2 NUMBER SYSTEMS addition, subtraction, multiplication, and division. Binary coding is another important issue. Numbers can be represented in a variety of codes, some of which are more useful than others in particular situations, and can be operated upon. Nevertheless, since arithmetic (numerical) data are not the only data type used, we also discuss codes for representing nonnumerical data, such as letters of the alphabet. Finally, we provide a brief introduction to the fundamentals of protecting against various transmission errors when data are transferred over communication links, and the principles of coding control instructions in a digital system.
  • Book cover image for: Introduction to Logic Design
    • Svetlana N. Yanushkevich, Vlad P. Shmerko(Authors)
    • 2008(Publication Date)
    • CRC Press
      (Publisher)
    2 Number Systems Computer Arithmetic Binary Octal Decimal Hexadecimal Binary arithmetic Sign and magnitude 1’s complement 2’s complement Addition and subtraction Residue arithmetics Modular adder Modular subtractor Modular multiplier Binary codes Gray code and Hamming distance Binary-coded decimal codes Weighted codes Advanced topics Number systems and cryptography Numbers and information Number Systems 21 2.1 Introduction The Binary Number System is the most important number system in digital design. This is because it is suited to the binary nature of the phenomena used in dominant microelectronic technology. Even in situations where the Binary Number System is not used as such, binary codes are employed to represent information at the signal level. For example, multi-valued logic values are often encoded using binary representations. However, humans prefer decimal numbers, – thus, that is, binary numbers must be converted into decimal numbers. In this chapter, various number systems are examined that are used in digital data structures. These number systems, such as octal and hexadecimal, are used to simplify the manipulation of binary numbers. 2.2 Positional numbers A number system is defined by Its basic symbols, called digits or numbers , and The ways in which the digits can be combined to represent the full range of numbers we need. 2.2.1 The decimal system The ten digits 0 , 1 , 2 , . . ., 9 can be combined in various ways to represent any number. The fundamental method of constructing a number is to form a sequence or string of digits or coefficients : d n − 1 · · · d 1 d 0 Integer part Decimal point ↓ • d − 1 d − 2 · · · d − m F ractional part String of digits or coef f icients where integer and fractional parts are represented by n and m digits to the left and to the right of the decimal point , respectively. The subscript i = − m, m − 1 , . . . , 0 , 1 , . . ., n gives the position of the digit.
  • Book cover image for: Digital Computer Structure and Design
    This implies a natural preference for binary devices, and thus the Binary Number System has been generally adopted for computer arithmetic. It can also be shown that the binary system is the most efficient way of storing and representing numbers. In binary arithmetic units the same type of logic devices can be used as in the control 70 Number Representation in Computers system, so that they are ubiquitous throughout the machine. There have been attempts to introduce decimal counting devices, but these have not been successful because they were special only to the arithmetic unit, as well as being more inefficient. A binary integer is therefore represented in the form α η α η _γ. . . . α4α 3 α 2 αια θ9 where the coefficients a 0 , a x , etc. may be either 1 or 0, and in the computer it would appear as: Binary integer X XXX XX a n #4 a$ a 2 #i a 0 where X can be either 1 or 0. binary point here A positive binary fraction would appear within the computer as: Binary fraction X X X X X X 0-1 Ä-2 0-3 0-4 0-5 <*-n binary point here Binary numbers are added in a similar way to decimal numbers, but the sum for each digit can be only 1 or 0, and there is a carry to the next higher digit if the sum in that position is greater than 1. This can be summarised in a table for two binary digits A and B and a carry from the previous position. A B Carry from next lower position Sum Carry out to next higher position As an example we have: 1 1 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Suml 1 0 0 0 0 1 1 The term binary digit has been abbreviated to 'bit' throughout the Computerworld. Decimal Codes Whatever base it may be decided to use for calculation within the computer, we are faced with the fact that in the outside world human Number Representation in Computers 71 beings prefer to think and work with numbers represented in decimal, or perhaps in one of the other units of weights and measures.
  • Book cover image for: Digital Electronic Circuits
    eBook - PDF

    Digital Electronic Circuits

    Principles and Practices

    • Shuqin Lou, Chunling Yang(Authors)
    • 2019(Publication Date)
    • De Gruyter
      (Publisher)
    2 Number systems and codes 2.1 Introduction Digital signals are generally represented by a series of binary digits. Binary Number System and digital codes are fundamental to digital circuits and digital systems. First, this chapter introduces number systems including binary, decimal, octal, and hexa-decimal, and conversion between different number systems. Then binary arithmetic operations with binary numbers are introduced. Finally, digital codes such as binary-coded decimal (BCD), excess-3 code, the Gray code, and the American Standard Code for Information Interchange (ASCII) code are covered. The objectives of this chapter are to – Describe binary, decimal, hexadecimal, and octal number system – Convert number representation between different number systems – Apply arithmetic operations to binary numbers – Express signed binary numbers in sign-magnitude, one ’ s complement, two ’ s complement – Describe BCD, excess-3 code, and Gray code. 2.2 Number systems Number system s are ways to represent the quantities. You are familiar with the decimal number system since you use decimal number in your daily lives. However, a digital circuit and a digital system belong to a two-valued system. A Binary Number System is the most efficient way to represent quantities. Hexadecimal and octal number systems are used primarily as a compact way of writing binary number since long binary numbers are difficult to read and write. In this section, we will begin with the structure of decimal number system that you are familiar with. This will help you more easily understand the structure of a Binary Number System, a hexadecimal system, and an octal system. Then, the structure of a Binary Number System, a hexadecimal system, and an octal system are introduced, because the same quantity can be represented by a decimal number, or an equivalent binary number, hexadecimal number, and octal number. Conversion between different number systems is introduced at the end of this section.
  • Book cover image for: Computer Arithmetic Algorithms
    1 CONVENTIONAL NUMBER SYSTEMS . 1 THE Binary Number System In conventional digital computers, integers are represented as binary numbers of fixed length. A binary number of length n is an ordered sequence ( x n -1 , x n-2 , N N N , x 1 , x o ) of binary digits where each digit x i (also known as a bit ) can assume one of the values 0 or 1. The length n of the sequence is of significance, since binary numbers in digital computers are stored in registers of a fixed length, n . The above sequence of n digits (or n -tuple) represents the integer value X ) x n-1 2 n-1 + x n-2 2 n-2 + N N N + x 1 2 + x o ) n -1 E x i 2 i . (1.1) i —o Upper case letters are used in this book to represent numerical values or se-quences of digits while lower case letters, usually indexed, represent individual digits. The weight of the digit x i in (1.1) is the i th power of 2, which is called the radix of the number system. The interpretation rule in Equation (1.1) is similar to the rule used for the ordinary decimal numbers. There are, however, two dif-ferences between these interpretation rules. First, the radix 10 is used instead of 2 in Equation (1.1) and consequently, the allowed digits in the decimal case are x i ; 0 , 1 , 2 , N N N , 9 i instead of x i ; 0 , 1 i . We call the decimal numbers radix-10 1 2 1. Conventional Number Systems numbers and the binary numbers radix-2 numbers. We indicate the radix to be used when interpreting a given sequence of digits by writing it as a subscript. Thus, the sequence (101) 10 represents the decimal value 101, while the sequence (101) 2 represents the decimal value 5. Since operands and results in an arithmetic unit are stored in registers of a fixed length, there is a finite number of distinct values that can be represented within an arithmetic unit. Let X E7z and X Ey? denote the smallest and largest representable values, respectively. We say that [ X E7z , X Ey? ] is the range of the representable numbers.
  • Book cover image for: Microelectronic Systems N2 Checkbook
    eBook - PDF
    2 Numbering systems A MAIN POINTS CONCERNED WITH NUMBERING SYSTEMS 1 In everyday situations, a system of counting using a base of ten is employed. This is known as a decimal or denary system, and its main justification for use is often quoted as being that human beings have ten fingers/thumbs with which to count. The characteristics of a decimal numbering system are: (i) a set often distinct counting digits (0, 1, 2, 3, 4, 5, 6, 7, 8 & 9), and (ii) a place value (or weight) for each digit, organised in ascending powers of ten starting from the right. Thus, for example, the decimal number 2658 10 may be considered as follows: 2658 10 (decimal) = 2 X 10 3 + 6 X 10 2 + 5 X 10 1 + 8 X 10° = 2000 + 6 0 0 + 5 0 + 8 2 A decimal system is not particularly suitable for direct use in electronic circuits. Due to practical limitations imposed by electronic devices, only two conditions are consistently predictable. These conditions are obtained when a chosen elec-tronic device is made to act as a switch, and its two states are on and off, represented by the logic symbols 1 and 0. This is known as 'two state logic', and each 1 or 0 is called a bit (binary digit). A digital computer performs its tasks by manipulating information which is represented by patterns of bits. 3 One convenient method of representing numbers in terms of two-state logic is to make use of the binary (base two) system. The characteristics of a binary counting system are: (i) two counting digits (1 and 0), and (ii) a place value (or weight) for each digit, organised in ascending powers of two starting from the right (see column 2 of Table 1 ). Thus, a 1 in a particular position of a binary number contributes its place value towards the total, but a 0 contributes nothing. Therefore, the decimal equivalent of a binary number may be obtained by adding together all of the place values where a 1 occurs in that binary number.
  • Book cover image for: The Tao of Computing
    In a typical binary machine, a common convention is that any voltage from 0 to 1.3 volts is interpreted as the digit 0, whereas voltages above 1.7 volts represent the digit 1. Having a range of voltages allows circuits to accommodate variations of voltage that may arise naturally. (Circuits are designed to avoid voltages between 1.3 and 1.7 volts. These intermediate voltages might be hard to interpret so such voltages may be considered errors.) With no other choices regarding possible digit values, processing can utilize simple and cheap on/ off circuits.
    Technically, a single 0 or 1 is called a bit of information. Such a data element is sufficient to hold the answer to a yes/no or true/false question, but a single bit is inadequate to store more general information. Thus, in a binary system, several bits typically are grouped together in various size units, so that they can hold greater information. A particularly common grouping involves 8 bits and is called a byte.
    To see how natural numbers, the integers staring with 0 and going higher, can be stored in a byte, consider the following number scheme. (If you know about the binary system, this will seem quite familiar.) Note that there are eight columns, or place values, because this is an 8-bit number. The placement of each 0 and 1 influences their value. To convert a binary number into a decimal number, start at the right of a sequence of 0s and 1s, and label the digits with a power of 2. Then add the labels corresponding to where the digit 1 appears in the sequence. The sidebar illustrates how to find the decimal value of a binary integer. The process is quite similar to our earlier example with base 10 (the decimal system), except now the digits are labeled with powers of 2.
    EXAMPLE: COMPUTING THE DECIMAL VALUE OF A BINARY INTEGER
    In the binary system, the location of each digit has a label (a power of 2) that indicates the relative weight of the digit
    In this system, 00000000 represents the decimal number 0, 00000001 represents the decimal number 1, 00000010 represents the decimal number 2, and so forth. Following this pattern, the largest binary number would be 11111111 or 128 + 64 + … + 2 + 1 (decimal) or 255. Altogether, this approach allows us to store the integers 0 through 255, inclusive, for an 8-bit number or byte; and we can conclude that one byte of data can take on 256 different values. Of course, this range is adequate for some data storage purposes in computers, but not for others. The 8-bit number with a range of 256 alternatives will arise several times later in this chapter and throughout the book.
  • Book cover image for: The Tao of Computing
    For example, when I attended a conference in Greece several years ago, I used local computers that naturally used a default Greek alphabet. When I viewed several pages developed in the United States, all text appeared using Greek letters— likely not what the authors expected. As these examples suggest, computer applications often must find an appropriate balance between speed and accuracy and between size and usability when they store data. The basic questions applications face involve how much accuracy is really required, how quickly results are needed, and how much flexibility is appropriate. In simple applications, the best tradeoff solutions may be obvious, or any choice may work well. In other cases, however, data management decisions can have a significant impact on the application’s effectiveness and the user’s satisfaction. The important decisions often depend on matters of data repre-sentation, so a basic understanding of representation issues can have a direct effect on our applications. Before I address your detailed questions about data storage, we need a common under-standing of some of the technical details involved in data representation. To get started, the sidebar serves as a reminder of how base 10 works as a place-value system for numbers. How Are Numbers and Characters Represented in a Computer (and Who Cares)? ◾ 35 Why do computers work in binary? The simplest, cheapest, and most reliable electrical circuits involve elementary on/off switches. When you flick a light switch on or off, electricity flows or it does not; a voltage is present or it is not. If we interpret the presence of voltage as the digit 1 and the lack of volt-age as the digit 0, then having a light on can be represented as 1, and having it off, as 0. In mathematics, numbers formed out of only the digits 0 and 1 are called binary numbers . The reasonably natural relationship between circuitry and binary numbers has made binary numbers an effective way to store data in computers.
  • Book cover image for: N3 Logic Systems
    eBook - PDF
    Suppose we need to write down the number, fifteen thousand five hundred and twenty four: we would write it as follows: 15 524 which seems very elementary but were we to analyse this number we would find that we actually wrote down the following. 15 units of thousand = 15 000 5 units of hundred = 500 2 units of ten = 20 4 units of one = 4 15 524 Since we are working in the decimal system we could also write the above number as: Thousands Hundreds Tens Ones 15 × 10 3 + 5 × 10 2 + 2 × 10 1 + 4 × 10 0 15 000 + 500 + 20 + 4 15 524 If we were now to add or subtract using the decimal number system, we would have to follow basic mathematical rules. Addition Subtraction 3 987 4 016 8 683 + 1 957 − 12 670 2 059 24 Module 2 • Number Systems, Arithmetic Elements, Codes and Data and Communication 2.2.2 The Binary Number System The Binary Number System consists of only two numbers as indicated by the “bi”, meaning two, in the word ‘binary’. Although we will use decimal numbers to describe the binary code we should remember that the decimal number will be to the base of two. A binary number has distinct characteristics as indicated by the following binary number. 1 0 1 0 0 1 1 0 0 2 Firstly, the binary number consists of bits. Each digit of a complete binary number is termed a bit and may only be a 1 or a 0. Therefore the binary number above consists of 9 bits. The binary digit to the extreme right of the binary number sequence above is termed the LSB (lease significant bit) and may never be discarded since it carries a weighted value which is used when a decimal to binary conversion is done. The binary digit on the extreme left of the binary sequence above, is termed the MSB (most significant bit) and is always a 1. The MSB is used when converting a decimal to a binary number. Now we need to find out how to obtain a binary number from a decimal number. This concept is illustrated in the following section.
  • Book cover image for: The Silicon Web
    eBook - PDF

    The Silicon Web

    Physics for the Internet Age

    • Michael G. Raymer(Author)
    • 2009(Publication Date)
    • CRC Press
      (Publisher)
    It makes no sense to tell someone you will pay him “1,000” to mow your lawn. The unit you prob-ably meant to specify is cents . Physicists like to use nicknames for familiar quantities, such as kilo for 10 3 . Calculations involving units are made simple by using conversion factors. This is akin to converting currency from, say, dollars to euros. Number systems are founded on counting. We discussed the base-ten and base-two counting systems and how to convert between them. Computers use the base-two or binary counting system. This is appropriate, because for storing numbers computers use memory cells that can store only one of two possible symbols, called 1 and 0. A binary digit or bit is a number that can take on only one of two possible values, 1 and 0. This means that each memory cell can store 1 bit. The amount of information that can 10 20 30 40 Years Number of rabbits 50 0 10 15 10 1 10 3 10 5 10 7 10 9 10 11 10 13 FIGURE 2.9 Exponential growth, plotted as the exponent of the number on the vertical axis (a log plot). Mathematics 43 be stored in a computer memory equals the number of memory cells. This equals the number of bits that can be stored. In Shannon’s 1948 paper, he explained a mathematical way to analyze information traveling in communication systems such as telephone lines. As we will discuss in later chapters, Shannon’s theory answered two main questions: How strongly can a mes-sage (or other data) be compressed without losing information? How much information (data) can a communication channel (such as a wire) transmit each second without errors occurring? These are important questions in the context of sending compressed data files, such as text, music, or video, across the Internet. In the next several chapters, we will study the areas of physics called mechanics, heat, and electromagnetism. These so-called classical areas of physics were discovered and explored during the period leading up to around 1900.
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.