The document provides information about computer arithmetic and binary number representation. It discusses addition and subtraction in binary, signed and unsigned numbers, overflow, and multiplication algorithms. It explains how binary addition and subtraction work using bit-by-bit operations. For multiplication, it describes the shift-add algorithm where the multiplicand is shifted and added to the product based on the multiplier bits. Hardware for implementing this algorithm with registers is also shown.
UNIT-II ARITHMETIC FOR COMPUTERS
Addition and Subtraction – Multiplication – Division – Floating Point Representation – Floating Point Addition and Subtraction.
Inductive programming incorporates all approaches which are concerned with learning programs or algorithms from incomplete (formal) specifications. Possible inputs in an IP system are a set of training inputs and corresponding outputs or an output evaluation function, describing the desired behavior of the intended program, traces or action sequences which describe the process of calculating specific outputs, constraints for the program to be induced concerning its time efficiency or its complexity, various kinds of background knowledge such as standard data types, predefined functions to be used, program schemes or templates describing the data flow of the intended program, heuristics for guiding the search for a solution or other biases.
Output of an IP system is a program in some arbitrary programming language containing conditionals and loop or recursive control structures, or any other kind of Turing-complete representation language.
In many applications the output program must be correct with respect to the examples and partial specification, and this leads to the consideration of inductive programming as a special area inside automatic programming or program synthesis, usually opposed to 'deductive' program synthesis, where the specification is usually complete.
In other cases, inductive programming is seen as a more general area where any declarative programming or representation language can be used and we may even have some degree of error in the examples, as in general machine learning, the more specific area of structure mining or the area of symbolic artificial intelligence. A distinctive feature is the number of examples or partial specification needed. Typically, inductive programming techniques can learn from just a few examples.
The diversity of inductive programming usually comes from the applications and the languages that are used: apart from logic programming and functional programming, other programming paradigms and representation languages have been used or suggested in inductive programming, such as functional logic programming, constraint
programming, probabilistic programming
Research on the inductive synthesis of recursive functional programs started in the early 1970s and was brought onto firm theoretical foundations with the seminal THESIS system of Summers[6] and work of Biermann.[7] These approaches were split into two phases: first, input-output examples are transformed into non-recursive programs (traces) using a small set of basic operators; second, regularities in the traces are searched for and used to fold them into a recursive program. The main results until the mid 1980s are surveyed by Smith.[8] Due to
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsSSE_AndyLi
This document discusses digital arithmetic and arithmetic circuits. It covers topics such as signed and unsigned binary numbers, addition, subtraction, overflow, binary-coded decimal codes, and the implementation of adders using full adders in VHDL. Specifically, it defines common digital arithmetic concepts like carries, sums, overflow, and binary number representations. It also describes half adders, full adders, ripple carry adders, and how to construct multi-bit adders using full adder components in VHDL.
The document discusses various number systems including decimal, binary, and signed binary numbers. It provides the following key points:
1) Decimal numbers use ten digits from 0-9 while binary only uses two digits, 0 and 1. Binary numbers represent values through place values determined by powers of two.
2) Conversions can be done between decimal and binary numbers through either summing the place value weights or repeated division/multiplication by two.
3) Binary arithmetic follows simple rules to add, subtract, multiply and divide numbers in binary representation.
4) Signed binary numbers use a sign bit to indicate positive or negative values, with the most common 2's complement form representing negative numbers as the 2's
This document summarizes different number systems used in computing including binary, octal, decimal, and hexadecimal. It explains how to convert between these number systems using theorems about their bases. Key topics covered include binary arithmetic, signed and unsigned integer representation, and how floating point numbers and characters are stored in binary format. Conversion charts are provided for binary to octal and hexadecimal. Representations of integers, characters, and floating point numbers in binary are also summarized.
The document discusses different number systems including binary, octal, decimal, and hexadecimal. It explains that number systems have a radix or base, which determines the set of symbols used and their positional values. The key representations for binary numbers discussed are sign-magnitude, one's complement, and two's complement, which provide different methods for representing positive and negative numbers. The document provides examples of addition, subtraction, multiplication, and division operations in binary.
1. The document describes the von Neumann architecture and its key components including the ALU, control unit, memory and I/O devices.
2. It explains the structure of the von Neumann machine and details the functions of components like the program counter, memory address register, and instruction register.
3. The document covers integer and floating point representation in binary, including sign-magnitude, two's complement, and IEEE 754 standard. It describes arithmetic operations like addition, subtraction, multiplication and division on binary numbers.
UNIT-II ARITHMETIC FOR COMPUTERS
Addition and Subtraction – Multiplication – Division – Floating Point Representation – Floating Point Addition and Subtraction.
Inductive programming incorporates all approaches which are concerned with learning programs or algorithms from incomplete (formal) specifications. Possible inputs in an IP system are a set of training inputs and corresponding outputs or an output evaluation function, describing the desired behavior of the intended program, traces or action sequences which describe the process of calculating specific outputs, constraints for the program to be induced concerning its time efficiency or its complexity, various kinds of background knowledge such as standard data types, predefined functions to be used, program schemes or templates describing the data flow of the intended program, heuristics for guiding the search for a solution or other biases.
Output of an IP system is a program in some arbitrary programming language containing conditionals and loop or recursive control structures, or any other kind of Turing-complete representation language.
In many applications the output program must be correct with respect to the examples and partial specification, and this leads to the consideration of inductive programming as a special area inside automatic programming or program synthesis, usually opposed to 'deductive' program synthesis, where the specification is usually complete.
In other cases, inductive programming is seen as a more general area where any declarative programming or representation language can be used and we may even have some degree of error in the examples, as in general machine learning, the more specific area of structure mining or the area of symbolic artificial intelligence. A distinctive feature is the number of examples or partial specification needed. Typically, inductive programming techniques can learn from just a few examples.
The diversity of inductive programming usually comes from the applications and the languages that are used: apart from logic programming and functional programming, other programming paradigms and representation languages have been used or suggested in inductive programming, such as functional logic programming, constraint
programming, probabilistic programming
Research on the inductive synthesis of recursive functional programs started in the early 1970s and was brought onto firm theoretical foundations with the seminal THESIS system of Summers[6] and work of Biermann.[7] These approaches were split into two phases: first, input-output examples are transformed into non-recursive programs (traces) using a small set of basic operators; second, regularities in the traces are searched for and used to fold them into a recursive program. The main results until the mid 1980s are surveyed by Smith.[8] Due to
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsSSE_AndyLi
This document discusses digital arithmetic and arithmetic circuits. It covers topics such as signed and unsigned binary numbers, addition, subtraction, overflow, binary-coded decimal codes, and the implementation of adders using full adders in VHDL. Specifically, it defines common digital arithmetic concepts like carries, sums, overflow, and binary number representations. It also describes half adders, full adders, ripple carry adders, and how to construct multi-bit adders using full adder components in VHDL.
The document discusses various number systems including decimal, binary, and signed binary numbers. It provides the following key points:
1) Decimal numbers use ten digits from 0-9 while binary only uses two digits, 0 and 1. Binary numbers represent values through place values determined by powers of two.
2) Conversions can be done between decimal and binary numbers through either summing the place value weights or repeated division/multiplication by two.
3) Binary arithmetic follows simple rules to add, subtract, multiply and divide numbers in binary representation.
4) Signed binary numbers use a sign bit to indicate positive or negative values, with the most common 2's complement form representing negative numbers as the 2's
This document summarizes different number systems used in computing including binary, octal, decimal, and hexadecimal. It explains how to convert between these number systems using theorems about their bases. Key topics covered include binary arithmetic, signed and unsigned integer representation, and how floating point numbers and characters are stored in binary format. Conversion charts are provided for binary to octal and hexadecimal. Representations of integers, characters, and floating point numbers in binary are also summarized.
The document discusses different number systems including binary, octal, decimal, and hexadecimal. It explains that number systems have a radix or base, which determines the set of symbols used and their positional values. The key representations for binary numbers discussed are sign-magnitude, one's complement, and two's complement, which provide different methods for representing positive and negative numbers. The document provides examples of addition, subtraction, multiplication, and division operations in binary.
1. The document describes the von Neumann architecture and its key components including the ALU, control unit, memory and I/O devices.
2. It explains the structure of the von Neumann machine and details the functions of components like the program counter, memory address register, and instruction register.
3. The document covers integer and floating point representation in binary, including sign-magnitude, two's complement, and IEEE 754 standard. It describes arithmetic operations like addition, subtraction, multiplication and division on binary numbers.
The document discusses binary number representation and arithmetic. It explains decimal to binary conversion. It also describes signed number representation using sign-magnitude and one's complement and two's complement methods. The key advantages of two's complement are that addition can be performed using the same method for positive and negative numbers. Subtraction using two's complement is performed by adding the number to the complement of the subtrahend. Examples of binary addition and subtraction are provided to illustrate these concepts.
Binary addition involves adding binary numbers by applying the following rules:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 with a carry of 1 to the next column.
To perform multi-bit addition, a half or full adder table is used to calculate the sum and carry out for each bit while accounting for any carries from the previous column. Examples are provided showing how addition is performed on multiple bits using the adder table and propagating any carries to the next position.
The document discusses different methods for representing signed binary numbers:
1) Sign-magnitude notation represents positive and negative numbers by using the most significant bit to indicate the sign (0 for positive, 1 for negative) and the remaining bits for the magnitude.
2) One's complement represents negative numbers by inverting all bits of the positive number.
3) Two's complement, the most common method, represents negative numbers by inverting all bits and adding 1 to the result. This allows simple addition to perform subtraction.
The document discusses various number systems used in digital electronics including decimal, binary, hexadecimal, and octal number systems. It provides details on how decimal, binary, and hexadecimal numbers are represented and converted between number systems. Various methods for converting between decimal, binary, hexadecimal, and octal numbers are presented including the sum-of-weights method and division/multiplication methods. The use of binary coded decimal codes for easier conversion between decimal and binary numbers is also covered.
This document discusses number representation systems used in computers, including binary, decimal, octal, and hexadecimal. It provides examples of converting between these different bases. Specifically, it covers:
1) Converting between decimal, binary, octal, and hexadecimal using positional notation and place values.
2) Representing signed integers in binary using ones' complement and twos' complement notation.
3) Tables for converting binary numbers to octal and hexadecimal using place values of each base.
4) Examples of converting values between the different number bases both manually and using the provided conversion tables.
This document provides an overview of Boolean algebra and logic gates. It begins with reviewing binary number systems, binary arithmetic, and binary codes. It then covers Boolean algebra, truth tables, canonical and standard forms. It also discusses logic operations and logic gates like Karnaugh maps up to 6 variables including don't care conditions. Finally, it discusses sum of products and products of sum representations.
The document summarizes computer arithmetic and the arithmetic logic unit (ALU). It discusses:
1) The ALU handles integer and floating point calculations. It may have a separate floating point unit.
2) There are different methods for representing integers like sign-magnitude and two's complement. Two's complement is commonly used.
3) Floating point numbers use a sign, significand, and exponent to represent real numbers in a normalized format like ±.significand × 2exponent.
The document provides information about number representation systems including binary, octal, hexadecimal, binary-coded decimal, and ASCII/Unicode character coding. It discusses how to convert between these different numbering systems, perform arithmetic operations like addition in each system, and describes features of each system such as the range of values that can be represented. Examples are provided to illustrate concepts like binary addition, 2's complement representation of negative numbers, and BCD addition. Control codes used in ASCII and the expanded character set of Unicode are also mentioned.
The document summarizes computer arithmetic and floating point representation. It discusses:
1) The arithmetic logic unit handles integer and floating point calculations. Integer values are represented in binary using two's complement. Floating point values use a sign-magnitude format with a fixed or moving binary point.
2) Addition and subtraction of integers is done through normal binary addition and subtraction. Multiplication requires generating partial products and addition. Division uses a long division approach.
3) Floating point numbers follow the IEEE 754 standard which represents values as ±mantissax2exponent in 32 or 64 bit formats. Arithmetic requires aligning operands and performing operations on significands and exponents.
This document discusses data representation and number systems in computers. It covers binary, octal, decimal, and hexadecimal number systems. Key points include:
- Data in computers is represented using binary numbers and different number systems allow for more efficient representations.
- Converting between number systems like binary, octal, decimal, and hexadecimal is explained through examples of dividing numbers and grouping bits.
- Signed numbers can be represented using complement representations like one's complement and two's complement, with subtraction implemented through addition of complements. Fast methods for calculating two's complement are described.
This document discusses uncertainty in measurement and significant figures. It explains that measurements have uncertainty due to limitations of instruments. Precision refers to the agreement between repeated measurements while accuracy is the agreement with the true value. There are two types of errors - random errors that can be high or low, and systematic errors that are always in the same direction. The document provides rules for determining the number of significant figures in measurements and calculations, including how significant figures are treated in addition, subtraction, multiplication and division.
The document discusses various number systems including binary, octal, hexadecimal and their conversions. It describes procedures to convert between different number bases by partitioning the numbers into groups of bits corresponding to the target base. The document also covers signed number representations, binary codes for encoding decimal digits, and fixed and floating point number representations.
Here are the answers to the assignment questions:
1. No overflow occurs when adding 00100110 + 01011010 in two's complement. The sum is 10001000.
2. See textbook 1 problem 2-1.c for the solution.
3. See textbook 1 problem 2-11.c for the solution.
4. See textbook 1 problem 2-19.c for the solution.
5. The decimal equivalent of the hexadecimal number 1A16 is 2610.
Binary arithmetic is essential for digital computers and systems. It involves adding, subtracting, multiplying, and dividing binary numbers using basic rules. Signed binary numbers represent positive and negative values using sign-magnitude, 1's complement, and 2's complement methods. Arithmetic operations on signed binary numbers follow rules for handling the sign bit and complement representations.
The document discusses different number systems used to represent numeric values in computers, including binary, octal, hexadecimal, and decimal. It provides examples of converting between these number systems using techniques like repeated division and multiplying digits by their place values. Character encoding schemes like ASCII, EBCDIC, and Unicode are also covered, explaining how they allow computers to represent letters, punctuation, and other characters with binary values.
The document discusses floating point numbers and the IEEE 754 standard. It describes how floating point numbers represent numbers with fractions using a sign bit, exponent field, and fraction field. The IEEE 754 standard uses a biased exponent representation for normalized floating point values, along with special values like infinity and NaN. It also details denormalized numbers, which allow gradual underflow to zero.
The document discusses various number systems including binary, decimal, octal and hexadecimal. It covers how to convert between these number systems using techniques like dividing by the base, tracking remainders, and grouping bits. Examples are provided for converting between the different systems. Common number prefixes like kilo, mega and giga are also explained in the context of computing.
Unit-1 Digital Design and Binary Numbers:Asif Iqbal
these slides contains general discerption about digital signals, binary numbers, digital numbers, and basic logic gates. it covers the first unit of AKTU syllabus.
This document provides an overview of Boolean algebra and logic gates. It discusses topics such as number systems, binary codes, Boolean algebra, logic gates, theorems of Boolean algebra, Boolean functions, simplification using Karnaugh maps, and NAND and NOR implementations. The document also describes binary arithmetic operations including addition, subtraction, multiplication, and division. It defines binary codes and discusses weighted and non-weighted binary codes.
This document provides an overview of Boolean algebra and logic gates. It discusses topics such as number systems, binary codes, Boolean algebra, logic gates, theorems of Boolean algebra, Boolean functions, simplification using Karnaugh maps, and NAND and NOR implementations. The document also describes binary arithmetic operations including addition, subtraction, multiplication, and division. It defines binary codes and discusses weighted and non-weighted binary codes.
The document discusses binary number representation and arithmetic. It explains decimal to binary conversion. It also describes signed number representation using sign-magnitude and one's complement and two's complement methods. The key advantages of two's complement are that addition can be performed using the same method for positive and negative numbers. Subtraction using two's complement is performed by adding the number to the complement of the subtrahend. Examples of binary addition and subtraction are provided to illustrate these concepts.
Binary addition involves adding binary numbers by applying the following rules:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 with a carry of 1 to the next column.
To perform multi-bit addition, a half or full adder table is used to calculate the sum and carry out for each bit while accounting for any carries from the previous column. Examples are provided showing how addition is performed on multiple bits using the adder table and propagating any carries to the next position.
The document discusses different methods for representing signed binary numbers:
1) Sign-magnitude notation represents positive and negative numbers by using the most significant bit to indicate the sign (0 for positive, 1 for negative) and the remaining bits for the magnitude.
2) One's complement represents negative numbers by inverting all bits of the positive number.
3) Two's complement, the most common method, represents negative numbers by inverting all bits and adding 1 to the result. This allows simple addition to perform subtraction.
The document discusses various number systems used in digital electronics including decimal, binary, hexadecimal, and octal number systems. It provides details on how decimal, binary, and hexadecimal numbers are represented and converted between number systems. Various methods for converting between decimal, binary, hexadecimal, and octal numbers are presented including the sum-of-weights method and division/multiplication methods. The use of binary coded decimal codes for easier conversion between decimal and binary numbers is also covered.
This document discusses number representation systems used in computers, including binary, decimal, octal, and hexadecimal. It provides examples of converting between these different bases. Specifically, it covers:
1) Converting between decimal, binary, octal, and hexadecimal using positional notation and place values.
2) Representing signed integers in binary using ones' complement and twos' complement notation.
3) Tables for converting binary numbers to octal and hexadecimal using place values of each base.
4) Examples of converting values between the different number bases both manually and using the provided conversion tables.
This document provides an overview of Boolean algebra and logic gates. It begins with reviewing binary number systems, binary arithmetic, and binary codes. It then covers Boolean algebra, truth tables, canonical and standard forms. It also discusses logic operations and logic gates like Karnaugh maps up to 6 variables including don't care conditions. Finally, it discusses sum of products and products of sum representations.
The document summarizes computer arithmetic and the arithmetic logic unit (ALU). It discusses:
1) The ALU handles integer and floating point calculations. It may have a separate floating point unit.
2) There are different methods for representing integers like sign-magnitude and two's complement. Two's complement is commonly used.
3) Floating point numbers use a sign, significand, and exponent to represent real numbers in a normalized format like ±.significand × 2exponent.
The document provides information about number representation systems including binary, octal, hexadecimal, binary-coded decimal, and ASCII/Unicode character coding. It discusses how to convert between these different numbering systems, perform arithmetic operations like addition in each system, and describes features of each system such as the range of values that can be represented. Examples are provided to illustrate concepts like binary addition, 2's complement representation of negative numbers, and BCD addition. Control codes used in ASCII and the expanded character set of Unicode are also mentioned.
The document summarizes computer arithmetic and floating point representation. It discusses:
1) The arithmetic logic unit handles integer and floating point calculations. Integer values are represented in binary using two's complement. Floating point values use a sign-magnitude format with a fixed or moving binary point.
2) Addition and subtraction of integers is done through normal binary addition and subtraction. Multiplication requires generating partial products and addition. Division uses a long division approach.
3) Floating point numbers follow the IEEE 754 standard which represents values as ±mantissax2exponent in 32 or 64 bit formats. Arithmetic requires aligning operands and performing operations on significands and exponents.
This document discusses data representation and number systems in computers. It covers binary, octal, decimal, and hexadecimal number systems. Key points include:
- Data in computers is represented using binary numbers and different number systems allow for more efficient representations.
- Converting between number systems like binary, octal, decimal, and hexadecimal is explained through examples of dividing numbers and grouping bits.
- Signed numbers can be represented using complement representations like one's complement and two's complement, with subtraction implemented through addition of complements. Fast methods for calculating two's complement are described.
This document discusses uncertainty in measurement and significant figures. It explains that measurements have uncertainty due to limitations of instruments. Precision refers to the agreement between repeated measurements while accuracy is the agreement with the true value. There are two types of errors - random errors that can be high or low, and systematic errors that are always in the same direction. The document provides rules for determining the number of significant figures in measurements and calculations, including how significant figures are treated in addition, subtraction, multiplication and division.
The document discusses various number systems including binary, octal, hexadecimal and their conversions. It describes procedures to convert between different number bases by partitioning the numbers into groups of bits corresponding to the target base. The document also covers signed number representations, binary codes for encoding decimal digits, and fixed and floating point number representations.
Here are the answers to the assignment questions:
1. No overflow occurs when adding 00100110 + 01011010 in two's complement. The sum is 10001000.
2. See textbook 1 problem 2-1.c for the solution.
3. See textbook 1 problem 2-11.c for the solution.
4. See textbook 1 problem 2-19.c for the solution.
5. The decimal equivalent of the hexadecimal number 1A16 is 2610.
Binary arithmetic is essential for digital computers and systems. It involves adding, subtracting, multiplying, and dividing binary numbers using basic rules. Signed binary numbers represent positive and negative values using sign-magnitude, 1's complement, and 2's complement methods. Arithmetic operations on signed binary numbers follow rules for handling the sign bit and complement representations.
The document discusses different number systems used to represent numeric values in computers, including binary, octal, hexadecimal, and decimal. It provides examples of converting between these number systems using techniques like repeated division and multiplying digits by their place values. Character encoding schemes like ASCII, EBCDIC, and Unicode are also covered, explaining how they allow computers to represent letters, punctuation, and other characters with binary values.
The document discusses floating point numbers and the IEEE 754 standard. It describes how floating point numbers represent numbers with fractions using a sign bit, exponent field, and fraction field. The IEEE 754 standard uses a biased exponent representation for normalized floating point values, along with special values like infinity and NaN. It also details denormalized numbers, which allow gradual underflow to zero.
The document discusses various number systems including binary, decimal, octal and hexadecimal. It covers how to convert between these number systems using techniques like dividing by the base, tracking remainders, and grouping bits. Examples are provided for converting between the different systems. Common number prefixes like kilo, mega and giga are also explained in the context of computing.
Unit-1 Digital Design and Binary Numbers:Asif Iqbal
these slides contains general discerption about digital signals, binary numbers, digital numbers, and basic logic gates. it covers the first unit of AKTU syllabus.
This document provides an overview of Boolean algebra and logic gates. It discusses topics such as number systems, binary codes, Boolean algebra, logic gates, theorems of Boolean algebra, Boolean functions, simplification using Karnaugh maps, and NAND and NOR implementations. The document also describes binary arithmetic operations including addition, subtraction, multiplication, and division. It defines binary codes and discusses weighted and non-weighted binary codes.
This document provides an overview of Boolean algebra and logic gates. It discusses topics such as number systems, binary codes, Boolean algebra, logic gates, theorems of Boolean algebra, Boolean functions, simplification using Karnaugh maps, and NAND and NOR implementations. The document also describes binary arithmetic operations including addition, subtraction, multiplication, and division. It defines binary codes and discusses weighted and non-weighted binary codes.
1) The ALU performs arithmetic operations like addition, subtraction, multiplication and division on fixed point and floating point numbers. Fixed point uses integers while floating point uses a sign, mantissa, and exponent.
2) Binary numbers are added using half adders and full adders which are logic circuits that implement addition using truth tables and K-maps. Subtraction is done using 1's or 2's complement representations.
3) Multiplication is done using sequential or Booth's algorithm approaches while division uses restoring or non-restoring algorithms. Floating point uses similar addition and subtraction steps but first normalizes the exponents.
The document discusses analogue and digital signals and number systems. It explains that the real world is analogue but digital signals are used for processing due to integrated circuits that can process digital data more easily. It then covers binary, octal, hexadecimal, and decimal number systems. Finally, it discusses representing negative numbers using sign-magnitude, 1's complement, and 2's complement representations and how arithmetic operations like addition and subtraction work using 2's complement.
- Digital computers perform arithmetic operations like addition, subtraction, multiplication and division on binary numbers.
- Signed binary numbers use the most significant bit as the sign bit to represent positive and negative values. Common representations are sign-magnitude, one's complement, and two's complement.
- Subtraction is performed using the two's complement method by taking the two's complement of the subtrahend and adding it to the minuend. Overflow needs to be handled for accurate results.
The document discusses arithmetic unit operations including addition, subtraction, multiplication, and division of signed and unsigned numbers. It covers integer representation using sign-magnitude, one's complement, and two's complement methods. Two's complement is identified as the best approach for integer representation as it simplifies arithmetic operations and overflow handling. The key hardware components for performing addition and subtraction of signed integers are also summarized.
The document discusses different number systems including decimal, binary, octal, and hexadecimal. It explains the concept of a base-N number system and how digits are arranged from most to least significant. It then provides more details on the decimal, binary, octal, and hexadecimal number systems including examples. The document also covers topics like 1's complement, 2's complement, signed numbers, arithmetic operations, and number conversions between different bases.
Binary addition, Binary subtraction, Negative number representation, Subtraction using 1’s complement and 2’s complement, Binary multiplication and division, Arithmetic in octal, hexadecimal number system, BCD and Excess – 3 arithmetic
Digital Logic Design Lecture 1A provides an overview of digital systems and binary numbers. It introduces the difference between analog and digital signals, the process of digitization, and the binary number system. The key concepts covered include representing numbers in binary format, converting between binary and decimal number systems using positional notation and weighted values, and introducing octal and hexadecimal numbering bases.
This document discusses decimal arithmetic operations using binary coded decimal (BCD) numbers. It describes how decimal numbers are represented in BCD format and processed using microoperations in the arithmetic logic unit (ALU). Addition and subtraction of decimal numbers are performed by converting the numbers to BCD, performing binary addition or subtraction on the digits, and converting the output back to decimal if needed. Block diagrams of BCD adders and examples of decimal addition and subtraction are provided.
This document provides lecture notes on digital system design. It covers topics like logic simplification, combinational logic design, understanding binary and other number systems, binary operations, and Boolean algebra. The first section discusses decimal, binary, octal and hexadecimal number systems. Later sections explain binary addition, subtraction, multiplication and conversions between number bases. Signed number representations like 1's complement and 2's complement are also introduced. Finally, the document discusses Boolean algebra, logic functions, truth tables, and basic logic gates like AND and INVERTER.
This document discusses digital electronics topics including number systems, codes, Boolean algebra, and digital circuits. It provides examples and explanations of converting between decimal, binary, octal, and hexadecimal number systems. Binary coded decimal, gray code, and excess-3 code are also defined. Combinational and sequential digital circuits as well as memory devices are listed as topics to be covered.
The document discusses binary multiplication and division. It describes how multiplication is performed by shifting and adding the multiplicand, and division is performed by repeatedly subtracting the divisor from the dividend and tracking the quotient and remainder. It also addresses techniques for efficient multiplication and division circuits and handling signed numbers and negatives.
The document summarizes computer arithmetic and the arithmetic logic unit (ALU). It discusses:
1) The ALU handles integer and floating point calculations. It may have a separate floating point unit.
2) There are different methods for representing integers like sign-magnitude and two's complement. Two's complement is commonly used.
3) Floating point numbers use a sign, significand, and exponent to represent real numbers in a normalized format like ±.significand × 2exponent.
The document discusses various methods for representing signed integers in binary, including signed magnitude, 1's complement, 2's complement, and excess binary. It provides examples of adding, subtracting, and multiplying numbers in binary using these different representations. 2's complement is described as the most common method used today due to its simplicity. The key aspects of 2's complement include representing negative numbers by flipping all bits and adding 1, and performing subtraction by adding the 2's complement. Overflow conditions for addition are also explained.
This document discusses number systems and binary arithmetic. It covers decimal, binary, octal and hexadecimal number systems. For binary, it explains how to convert between decimal and binary, and discusses binary addition, subtraction, and complement representations. The key advantages of using two's complement for binary numbers are that addition and subtraction can both be performed using the same hardware circuitry.
This document contains an exercise on digital electronics concepts including:
1. The differences between analog and digital measurements and pros and cons of analog vs digital electronics.
2. Tables defining binary, octal, decimal, and hexadecimal number systems.
3. Practice problems converting between number systems and performing basic binary math operations like addition, subtraction, multiplication, and division.
4. An independent practice section with additional problems converting between number systems and performing binary math.
The document discusses different number systems including decimal, binary, hexadecimal, and octal. It provides details on:
- The characteristics of each system such as the symbols used and positional notation.
- Conversions between decimal, binary, hexadecimal, and octal.
- Representations of signed and unsigned integers in binary, and the signed number systems of signed magnitude, ones' complement, and twos' complement.
- Arithmetic operations like addition and subtraction for unsigned and signed integers in twos' complement representation.
Cloud computing allows users to access computing resources like servers, storage, databases, networking, software, analytics and more over the internet. It provides on-demand access to a shared pool of configurable computing resources that can be rapidly provisioned and released with minimal management effort. Some key characteristics of cloud computing include centralization of infrastructure, increased peak-load capacity, efficiency improvements, dynamic allocation of resources, and consistent monitored performance. There are various deployment and service models used in cloud computing like public, private, hybrid, community clouds and Infrastructure as a Service (IaaS), Platform as a Service (PaaS), Software as a Service (SaaS).
Hadoop is an open-source framework that allows distributed processing of large datasets across clusters of computers. It has two major components - the MapReduce programming model for processing large amounts of data in parallel, and the Hadoop Distributed File System (HDFS) for storing data across clusters of machines. Hadoop can scale from single servers to thousands of machines, with HDFS providing fault-tolerant storage and MapReduce enabling distributed computation and processing of data in parallel.
The document discusses several security challenges related to cloud computing. It covers topics like data breaches, misconfiguration issues, lack of cloud security strategy, insufficient identity and access management, account hijacking, insider threats, and insecure application programming interfaces. The document emphasizes that securing customer data and applications is critical for cloud service providers to maintain trust and meet compliance requirements.
This document discusses Service Oriented Architecture (SOA) and Representational State Transfer (REST) systems of systems. It describes how SOA has evolved over time to include grids, clouds, and systems of systems. REST is characterized as an architectural style for building distributed hypermedia systems and leverages existing web technologies like HTTP and XML. In a REST system, resources are addressable via URIs and clients interact with servers by transferring representations of resources through standardized interfaces and operations.
The document discusses six key architectural design challenges in cloud computing:
1) Service availability and data lock-in due to proprietary APIs
2) Data privacy and security concerns due to increased attacks in public clouds
3) Unpredictable performance and bottlenecks due to I/O interference between VMs
4) Issues with distributed storage and widespread software bugs at large scale
5) Ensuring cloud scalability, interoperability, and standardization across providers
6) Addressing software licensing and reputation sharing in cloud environments
The document provides information about computer arithmetic and binary number representation. It discusses addition and subtraction in binary, signed and unsigned numbers, overflow, and multiplication algorithms. It explains how binary addition and subtraction work using bit-by-bit operations. For multiplication, it describes the shift-add algorithm where the multiplicand is shifted and added to the product based on the multiplier bits. Hardware for implementing this algorithm with registers is also shown.
Understanding Inductive Bias in Machine LearningSUTEJAS
This presentation explores the concept of inductive bias in machine learning. It explains how algorithms come with built-in assumptions and preferences that guide the learning process. You'll learn about the different types of inductive bias and how they can impact the performance and generalizability of machine learning models.
The presentation also covers the positive and negative aspects of inductive bias, along with strategies for mitigating potential drawbacks. We'll explore examples of how bias manifests in algorithms like neural networks and decision trees.
By understanding inductive bias, you can gain valuable insights into how machine learning models work and make informed decisions when building and deploying them.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTjpsjournal1
The rivalry between prominent international actors for dominance over Central Asia's hydrocarbon
reserves and the ancient silk trade route, along with China's diplomatic endeavours in the area, has been
referred to as the "New Great Game." This research centres on the power struggle, considering
geopolitical, geostrategic, and geoeconomic variables. Topics including trade, political hegemony, oil
politics, and conventional and nontraditional security are all explored and explained by the researcher.
Using Mackinder's Heartland, Spykman Rimland, and Hegemonic Stability theories, examines China's role
in Central Asia. This study adheres to the empirical epistemological method and has taken care of
objectivity. This study analyze primary and secondary research documents critically to elaborate role of
china’s geo economic outreach in central Asian countries and its future prospect. China is thriving in trade,
pipeline politics, and winning states, according to this study, thanks to important instruments like the
Shanghai Cooperation Organisation and the Belt and Road Economic Initiative. According to this study,
China is seeing significant success in commerce, pipeline politics, and gaining influence on other
governments. This success may be attributed to the effective utilisation of key tools such as the Shanghai
Cooperation Organisation and the Belt and Road Economic Initiative.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
3. Syllabus – Unit II
UNIT-II ARITHMETIC FOR COMPUTERS
Introduction - Addition and Subtraction – Multiplication:
Sequential version of the Multiplication Algorithm and Hardware,
Signed Multiplication – Division: A Division Algorithm and
Hardware, Signed Division – Floating Point Representation –
Conversion: Decimal to Binary Floating Point and Binary to
Decimal Floating Point – Floating Point Addition and
Subtraction.
4. Text Books
• Book 1:
o Name: Computer Organization and Design: The Hardware/Software
Interface
o Authors: David A. Patterson and John L. Hennessy
o Publisher: Morgan Kaufmann / Elsevier
o Edition: Fifth Edition, 2014
• Book 2:
o Name: Computer Organization and Embedded Systems Interface
o Authors: Carl Hamacher, Zvonko Vranesic, Safwat Zaky and Naraig Manjikian
o Publisher: Tata McGraw Hill
o Edition: Sixth Edition, 2012
5. • numbers may be represented in any base
• Computer - base 2 numbers are called binary numbers
• A single digit of a binary number is the “atom” of computing,
since all information is composed of binary digits or bit.
• Alternatives: high or low, on or off , true or false, or 1 or 0
• Least Significant Bit(LSB): The rightmost bit in a MIPS word.
• Most Significant Bit(MSB): The left most bit in a MIPS word
Numbers
6. The Binary Number System
• Name
o “binarius” (Latin) => two
• Characteristics
o Two symbols
• 0 1
o Positional
• 1010B ≠ 1100B
• Most (digital) computers use the binary number
system Terminology
• •Bit: a binary digit
• •Byte: (typically) 8 bits
7. Number Representation
• Three systems:
o Sign-and-magnitude
o 1’s complement
o 2’s complement
• In all three systems, the leftmost bit is 0 for positive
numbers and 1 for negative numbers.
• Positive values have identical representations in all
systems.
• Negative values have different representations.
• Ex: 10112
8. • Sign Magnitude: One's Complement Two's Complement
000 = 0 000 = 0 000 = 0
001 = +1 001 = +1 001 = +1
010 = +2 010 = +2 010 = +2
011 = +3 011 = +3 011 = +3
100 = 0 100 = -3 100 = -4
101 = -1 101 = -2 101 = -3
110 = -2 110 = -1 110 = -2
111 = -3 111 = 0 111 = -1
• Issues:
o balance – equal number of negatives and positives
o ambiguous zero – whether more than one zero representation
o ease of arithmetic operations
•
Possible Representations
ambiguous
zero
ambiguous
zero
9. Signed Magnitude
• In this notation, an extra bit is added to the left of the
number to notate its sign.
• 0 indicates +ve and 1 indicates -ve.
• Using 8 bits,
• +13 is 00001101 and +11 is 00001011.
• -13 is 10001101 and -11 is 10001011.
10. 1's Complement
• In this notation positive numbers are represented exactly
as regular binary numbers.
• Negative numbers are represented simply by flipping the
bit, i.e. 0's become 1 and 1's become 0.
• So 13 will be 00001101 and 11 will be 00001011.
• -13 will be 11110010 and -11 will be 11110100.
11. 2's Complement
• In this method a negative number is notated by first
determining the 1's complement of the positive number
and then adding 1 to it.
• So 8-bit -13 will be 11110010
• (1's complement) + 1 = 11110011;
• -11 will be 11110101.
30. Example
• When adding or subtracting 2's complement binary
numbers, any extra (carry over) bits are discarded.
• 13–11
• 13 + (-11)
• 00001101 + 11110101
•
31. Overflow
• When the actual result of an arithmetic operation is
outside the representable range, an arithmetic
overflow has occurred.
• No overflow when adding a positive and a negative
number
• No overflow when subtracting numbers with the same
sign
• Overflow occurs when adding two positive numbers
produces a negative result, or when adding two
negative numbers produces a positive result.
33. Overflow - Example
• No overflow when adding a positive and a negative
number
• A+B
• A = +3
• B = -2
+3 => 011
-2 => 110
• -----------
+1 => 001
• Result -
n=3 bits => Range: - 4 to +3
+3 011
+2 010
+1 001
0 000
-1 111
-2 110
-3 101
-4 100
34. Overflow - Example
• No overflow when subtracting numbers with the same
sign
• A - B
• A = - 3
• B = - 2
• (-3) – (-2) => -3 + 2
-3 => 101
+2 => 010
• -----------
-1 => 111
• Result -
n=3 bits => Range: - 4 to +3
+3 011
+2 010
+1 001
0 000
-1 111
-2 110
-3 101
-4 100
35. Overflow - Example
• Overflow occurs when adding two positive numbers
produces a negative result, or when adding two
negative numbers produces a positive result.
• A + B
• A = + 3
• B = + 3
+3 => 011
+3 => 011
• -----------
-2 => 110
n=3 bits => Range: - 4 to +3
+3 011
+2 010
+1 001
0 000
-1 111
-2 110
-3 101
-4 100
36. • No overflow when adding a positive and a negative number
• No overflow when subtracting numbers with the same sign
• Overflow occurs when the result has “wrong” sign (verify!):
Operation Operand A Operand B Result
Indicating Overflow
A + B 0 0 0
A + B 0 0 0
A – B 0 0 0
A – B 0 0 0
• Consider the operations A + B, and A – B
o can overflow occur if B is 0 ?
o can overflow occur if A is 0 ?
Detecting Overflow
37. Questions
1. Subtract (11010)2 – (10000)2 using 2’s complement method.
2. Subtract (11011)2 – (10011)2 using 2’s complement.
Solution:
39. Multiply
• Grade school shift-add method:
Multiplicand 1000
Multiplier 1001
x 1000
0000
0000
1000
Product 01001000
• m bits x n bits = m+n bit product
• Binary makes it easy:
o multiplier bit 1 => copy multiplicand (1 x multiplicand)
o multiplier bit 0 => place 0 (0 x multiplicand)
x
Intermediate
products
40. Sequential Version of the Multiplication Algorithm and
Hardware
64-bit ALU
Control test
Multiplier
Shift right
Product
Write
Multiplicand
Shift left
64 bits
64 bits
32 bits
Done
1. Test
Multiplier0
1a. Add multiplicand to product and
place the result in Product register
2. Shift the Multiplicand register left 1 bit
3. Shift the Multiplier register right 1 bit
32nd repetition?
Start
Multiplier0 = 0
Multiplier0 = 1
No: < 32 repetitions
Yes: 32 repetitions
Multiplicand register, product register, ALU are
64-bit wide; multiplier register is 32-bit wide
Algorithm
32-bit multiplicand starts at right half of multiplicand register
Product register is initialized at 0
Hardware
41. Sequential Version of the Multiplication Algorithm and
Hardware
• Basic 3 steps:
1. if LSB multiplier ==1
Product = Product + Multiplicand
else
No operation
1. Shift the multiplicand left
2. Shift the multiplier right
44. Signed Multiplication
Booth Algorithm
The Booth Algorithm:
• The Booth algorithm generates a 2n-bit product
and treats both positive and negative
2’scomplement n-bit operands uniformly.
• The Booth algorithm has two attractive features.
First, it handles both positive and negative multipliers
uniformly.
Second, it achieves some efficiency in the number of
additions required when the multiplier has a few large blocks of
1s.
46. Booth Algorithm
Booth Recoded Multipliers
Ex: -6
-6 in 2’s complement is 11010
11010 0
Peform recoding
1 1 0 1 0 0
Add a zero to
the RHS of the
multiplier
0
-1
+1
-1
So this is the
recoded multiplier
0
47. Questions
• Find the Booth recoded multiplier for the given numbers:
1. -14
2. -5
3. -12
48. Booth Multiplication
• Let us perform +13 * -6
Steps:
• Recode the multiplier
-6 when recoded is 0 -1 +1 -1 0
+13 = 0 1 1 0 1
- 6 = 0-1+1-10
Note:
Multiplier bit is :
0 All 0s
+1 multiplicand
-1 2’s c of multiplicand
0 1 1 0 1
X 0-1+1-10
0 0 0 0 0
1 0 0 1 1
0 1 1 0 1
1 0 0 1 1
0 0 0 0 0
1 1 1 1 0 1 1 0 0 1 0
0 0 0 0 0
1 1 1 1
0 0 0
1 1
0
Final Product = 11101100102 = -7810
Carry is ignored
50. 1001 Quotient
Divisor 1000 1001010 Dividend
–1000
10
101
1010
–1000
10 Remainder
• Junior school method: see how big a multiple of the divisor can be
subtracted, creating quotient digit at each step
• Binary makes it easy first, try 1 * divisor; if too big, 0 * divisor
• Dividend = (Quotient * Divisor) + Remainder
Division
51. Restoring Division
64-bit ALU
Control
test
Quotient
Shift left
Remainder
Write
Divisor
Shift right
64 bits
64 bits
32 bits
Done
Test Remainder
2a. Shift the Quotient register to the left,
setting the new rightmost bit to 1
3. Shift the Divisor register right 1 bit
33rd repetition?
Start
Remainder < 0
No: < 33 repetitions
Yes: 33 repetitions
2b. Restore the original value by adding
the Divisor register to the Remainder
register and place the sum in the
Remainder register. Also shift the
Quotient register to the left, setting the
new least significant bit to 0
1. Subtract the Divisor register from the
Remainder register and place the
result in the Remainder register
Remainder > 0
–
Divisor register, remainder register, ALU are
64-bit wide; quotient register is 32-bit wide
Algorithm
32-bit divisor starts at left half of divisor register
Remainder register is initialized with the dividend at right
Why 33? We shall see later…
Quotient register is
initialized to be 0
52. Division
Done
Test Remainder
2a. Shift the Quotient register to the left,
setting the new rightmost bit to 1
3. Shift the Divisor register right 1 bit
33rd repetition?
Start
Remainder < 0
No: < 33 repetitions
Yes: 33 repetitions
2b. Restore the original value by adding
the Divisor register to the Remainder
register and place the sum in the
Remainder register. Also shift the
Quotient register to the left, setting the
new least significant bit to 0
1. Subtract the Divisor register from the
Remainder register and place the
result in the Remainder register
Remainder > 0
–
Itera- Step Quotient Divisor Remainder
tion
0 init 0000 0010 0000 0000 0111
1 1 0000 0010 0000 1110 0111
2b 0000 0010 0000 0000 0111
3 0000 0001 0000 0000 0111
2 1 0000 0001 0000 1111 0111
2b 0000 0001 0000 0000 0111
3 0000 0000 1000 0000 0111
3 1 0000 0000 1000 1111 1111
2b 0000 0000 1000 0000 0111
3 0000 0000 0100 0000 0111
4 1 0000 0000 0100 0000 0011
2a 0001 0000 0100 0000 0011
3 0001 0000 0010 0000 0011
5 1 0001 0000 0010 0000 0001
2a 0011 0000 0010 0000 0001
3 0011 0000 0001 0000 0001
Example: 0111 / 0010:
Algorithm
R = Reminder – Divisor
R = 0000 0111 – 0010 0000
R = 1110 0111
Restore,
R = R + D
R = Reminder – Divisor
R = 0000 0111 – 0001 0000
R = 1111 0111
Restore,
R = R + D
R = Reminder – Divisor
R = 0000 0111 – 0000 1000
R = 1111 1111
Restore,
R = R + D
R = Reminder – Divisor
R = 0000 0111 – 0000 0100
R = 0000 0011
R = Reminder – Divisor
R = 0000 0011 – 0000 0010
R = 0000 0001
56. Floating Point
• We need a way to represent
o numbers with fractions, e.g., 3.1416
o very small numbers (in absolute value), e.g.,
.00000000023
o very large numbers (in absolute value) , e.g., –
3.15576 * 1046
57. Floating Point
• Scientific Notation:
o A notation that renders numbers with a single digit to
the left of the decimal point.
o Ex: 1.0 X 10-9
o 3.15576 X 109
• Normalized Number:
o A number in floating point notation that has no leading
0s.
o Ex: 1.0 X 10-9
o 1.0 X 2-1
• Binary form: 1.xxxxxx X 2
58. Exercise
Change the following binary numbers into normalized number:
Hint: a single non-zero digit to the left of the binary point.
Binary Value Normalized Value
10000.11 1.000011 x 24
10.0 × 2-9
(0.010101)2×24
.0000011001
10000011.0
.00101
59. Floating Point
Representation
• IEEE 754 floating point standard:
o single precision: one word
o double precision: two words
31
sign
bits 30 to 23
8-bit exponent
bits 22 to 0
23-bit fraction
31
sign
bits 30 to 20
11-bit exponent
bits 19 to 0
upper 20 bits of 52-bit fraction
bits 31 to 0
lower 32 bits of 52-bit fraction
60. Floating Point Representation
• Sign bit
o The sign of a binary floating-point number is represented by a
single bit.
o A 1 bit indicates a negative number, and a 0 bit indicates a
positive number.
• Fraction:
o The value, generally between 0 and 1, placed in the fraction field. The
fraction is also called the mantissa.
• Exponent:
o In the numerical representation system of floating-point arithmetic, the
value that is placed in the exponent field.
• Example:
+1.10101 x 25
Sign bit = 0
(positive)
Fraction =
.10101
Exponent = 5
61. Floating Point
• Still use a fixed number of bits
o Sign bit S, exponent E, significand F
o Value: (-1)S x (1+F) x 2E
• IEEE 754 standard
6
1
Size Sign bit Exponent Fraction or
Significand
Range
Single
precision
32b 1b 8b 23b 2x10+/-38
Double
precision
64b 1b 11b 52b 2x10+/-308
S E F
62. Biased Exponent
• A biased exponent is the result of adding some
constant(called the bias) to the exponent to make the
range of the exponent nonnegative.
• Biased exponent = Exponent + bias
• Bias = 2n-1 – 1
• Single : 127 , Double : 1023
• Example: 1.101 x 25
Biased Exponent = 5 + 127 =132 (1000 0100)
• Example: 1.01001 x 2-3
Biased Exponent = -3 + 127 =124 (0111 1100)
64. Excess or Biased
Exponent
• Value: (-1)S x (1 + F) x 2(E-bias)
o SP: bias is 127
o DP: bias is 1023
6
4
Exponent 2’s Compl Excess-127
-127 1000 0001 0000 0000
-126 1000 0010 0000 0001
… … …
+127 0111 1111 1111 1110
65. FP Overflow/Underflow
• FP Overflow
o Analogous to integer overflow
o Result is too big to represent
o Means exponent is too big
• FP Underflow
o Result is too small to represent
o Means exponent is too small (too negative)
• Both can raise an exception under IEEE754
6
5
66. IEEE754 Special Cases
6
6
Single Precision Double Precision Value
Exponent Significand Exponent Significand
0 0 0 0 0
0 nonzero 0 nonzero denormalized
1-254 anything 1-2046 anything fp number
255 0 2047 0 infinity
255 nonzero 2047 nonzero NaN (Not a
Number)
67. Show the IEEE 754 binary
representation of the number -0.75ten in
single and double precision
Converting -0.75ten to binary
0.75 x 2 = 1.50 (take only integral part, ie 1)
0.50 x 2 = 1.00
0.11 x 2 0
After Normalizing the above value is 1.1 x 2 -1
The general representation for a single precision no is
(-1)S x (1 + F) x 2(E-127)
Subtracting the bias 127 from the exponent of
-1.1two x 2-1 yields
(-1)1 x (1+.1000 0000 0000 0000 0000 000two) x 2(126-127)
(Contd…)
68. (Contd…)
The single precision binary representation of -0.75ten is then
The double precision representation is
Show the IEEE 754 binary
representation of the number -0.75ten in
single and double precision
69. Exercise
• Represent the following numbers in Single and Double
precision formats.
1. +.0000001101011
2. -.00101
71. Exercise
• Assuming single precision IEEE 754 format, what
decimal number is represent by this word?
1 01111101 00100000000000000000000
72. Floating Point Addition
• Binary floating point addition:
• Steps:
1. Compare the exponents of the two numbers; shift the
smaller number to the right until its exponent would
match the larger exponent
2. Add the significands
3. Normalize the sum, either shifting right and
incrementing the exponent or shifting left and
decrementing the exponent
4. Round the significand to the appropriate number of bits