Review of Number Systems
Review of Number Systems
𝑉(𝐷) = 𝑑𝑖 ×10𝑖
𝑖=0
• This is referred to as the positional number representation.
• Because the digits have 10 possible values and each digit is weighted as a power of 10
• we may say that decimal numbers are base-10, or radix-10 numbers.
• But in digital circuits it is not practical to use digits that can assume 10
values. Stephen Brown, Zvonko Vranesic, “Fundamentals of Digital
logic with Verilog Design”, Tata McGraw Hill Publishing
Company Limited, Special Indian Edition
Binary Number System
• In digital systems we use the binary, or base-2 or radix-2 number system in
which digits (bi) can be 0 or 1. Each binary digit is called a bit.
• Using positional number representation, a binary number can be written as,
B = bn−1bn−2 ・ ・ ・ b1b0
• And B represents an integer that has the decimal value V(B) as,
V(B) = bn−1 × 2n−1 + bn−2 × 2n−2 +・ ・ ・+b1 × 21 + b0 × 20
𝑛−1
𝑉(𝐵) = 𝑏𝑖 ×2𝑖
𝑖=0
• For example, the binary number 1010 represents the value
V = 1 × 23 + 0 × 22 + 1 × 21 + 0 × 20
Stephen Brown, Zvonko Vranesic, “Fundamentals of Digital
logic with Verilog Design”, Tata McGraw Hill Publishing
Company Limited, Special Indian Edition
Contd..
• We can indicate the radix as a subscript when there is potential for
confusion.
• So, 1010 is a base-2 number, and we shall write it as (1010)2.
• Evaluating the preceding expression for V
• => V = 1 × 23 + 0 × 22 + 1 × 21 + 0 × 20 = 8 + 4 + 1 = 10.
• Hence (1010)2 = (10)10 ; (1111)2 = (15)10.
• In general, using n bits allows representation of integers in the range 0
to 2n −1
𝑉(𝐾) = 𝑘𝑖𝑟 𝑖
𝑖=0
• Our interest is limited to those radices that are most practical.
• We will use decimal numbers because they are used by people
• we will use binary numbers because they are used by computers.
• In addition, two other radices are also useful—8 and 16.
• Numbers represented with radix-8 are called octal numbers
• Radix-16 numbers are called hexadecimal
Stephen Brown, numbers.
Zvonko Vranesic, “Fundamentals of Digital
logic with Verilog Design”, Tata McGraw Hill Publishing
Company Limited, Special Indian Edition
Contd..
• In octal representation the digit values
range from 0 to 7.
• In hexadecimal representation (often
abbreviated as hex), each digit can have
one of 16 values.
• The first ten are denoted the same as in the
decimal system, namely, 0 to 9.
• Digits that correspond to the decimal values
10, 11, 12, 13, 14, and 15 are denoted by the
letters, A, B, C, D, E, and F
• In computers the dominant number
system is binary.
• The reason for using the octal and
hexadecimal systems is that they serve
as a useful shorthand notation for binary
numbers.
Stephen Brown, Zvonko Vranesic, “Fundamentals of Digital
logic with Verilog Design”, Tata McGraw Hill Publishing
Company Limited, Special Indian Edition
Conversion between Octal and Binary
Numbers
• One octal digit represents three binary bits.
• Thus a binary number is converted into an octal number by:
1. Take as groups of three bits starting from LSB, and
2. Replacing each of the group with the corresponding octal digit.
• For example, 101011010111 is converted as