This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.

Slides:



Advertisements
Similar presentations
Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
Advertisements

Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Lecture - 2 Number systems and computer data formats
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Process for changing “C-based” design to SHARC assembler ADDITIONAL EXAMPLE M. R. Smith, Electrical and Computer Engineering University of Calgary, Canada.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Software and Hardware Circular Buffer Operations First presented in ENCM There are 3 earlier lectures that are useful for midterm review. M. R.
6/3/20151 ENCM515 Comparison of Integer and Floating Point DSP Processors M. Smith, Electrical and Computer Engineering, University of Calgary, Canada.
Generation of highly parallel code for TigerSHARC processors An introduction This presentation will probably involve audience discussion, which will create.

8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Floating Point Numbers
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic Part 4.
Binary Arithmetic Math For Computers.
Binary Representation and Computer Arithmetic
Simple Data Type Representation and conversion of numbers
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
Fixed-Point Arithmetics: Part II
IT253: Computer Organization
Oct. 18, 2007SYSC 2001* - Fall SYSC2001-Ch9.ppt1 See Stallings Chapter 9 Computer Arithmetic.
Understanding the TigerSHARC ALU pipeline Determining the speed of one stage of IIR filter – Part 2 Understanding the pipeline.
Floating-Point Representation We can store integers and characters easily in binary, but what about fractions? ¼ =.25 = 2.5 * *
Computer Arithmetic See Stallings Chapter 9 Sep 10, 2009
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Monday, January 14 Homework #1 is posted on the website Homework #1 is posted on the website Due before class, Jan. 16 Due before class, Jan. 16.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
Systematic development of programs with parallel instructions SHARC ADSP21XXX processor M. Smith, Electrical and Computer Engineering, University of Calgary,
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Compsci 210 Tutorial Two CompSci Semester Two 2016.
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
CS/COE0447 Computer Organization & Assembly Language
A Level Computing Component 2
Data Structures Mohammed Thajeel To the second year students
واشوقاه إلى رمضان مرحباً رمضان
Overview of SHARC processor ADSP and ADSP-21065L
DMA example Video image manipulation
Overview of SHARC processor ADSP Program Flow and other stuff
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
ECEG-3202 Computer Architecture and Organization
* M. R. Smith, University of Calgary, Alberta,
Comparing 68k (CISC) with 21k (Superscalar RISC DSP)
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
Understanding the TigerSHARC ALU pipeline
Overview of TigerSHARC processor ADSP-TS101 Compute Operations
* L. E. Turner and M. R. Smith, University of Calgary, Alberta, Canada
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
March 27 Test 2 Review Read Sections 5.1 through 5.3.
* L. E. Turner and M. R. Smith, University of Calgary, Alberta, Canada
Explaining issues with DCremoval( )
DMA example Video image manipulation
Overview of SHARC processor ADSP-2106X Compute Operations
Overview of SHARC processor ADSP-2106X Compute Operations
* L. E. Turner and M. R. Smith, University of Calgary, Alberta, Canada
Overview of SHARC processor ADSP-2106X Memory Operations
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
* M. R. Smith 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
Presentation transcript:

This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during your presentation In Slide Show, click on the right mouse button Select “Meeting Minder” Select the “Action Items” tab Type in action items as they come up Click OK to dismiss this box This will automatically create an Action Item slide at the end of your presentation with your points entered. SHARC Processor Characteristics Number Representations When = 2 BUT 2 *2 != 4 M. R. Smith, Electrical and Computer Engineering University of Calgary, Alberta, Canada ucalgary.ca

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 2 / 28 To tackled zNumber Representations are varied zMake sure you understand them zCan solve many coding errors by recognizing improper use of number representations zSHARC default number representation for integers is not what is expected. zUnderstanding Number Representations allows for extra speed in that 1 in 1000 situation

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 3 / 28 Number Representations zNumber representations are important. zThis is a talk about the number representations on the Analog Devices ADSP SHARC yProcessor has “C-like” syntax for assembly code yBoth single cycle integer and float operations y32-bit registers (integer and float) zFor more information see the article Smith, M. R., "Quirks and SHARCs -- Issues in programming the Analog Devices SHARC processor. When = 2 but != 4", Circuit Cellar, March 2001.

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 4 / 28 Recap -- Bit patterns in memory zBit values stored in memory yCan represent what you like yhash table, ascii characters, signed and unsigned integer numbers (various precisions), floating point numbers etc. zCertain number representations more easily supported by the processor for various operations than others. zOn SHARC bit integers and FP, also 40-bit FP (extended FP).

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 5 / 28 Example -- Eight Bit Values zUnsigned 8-bit integers yRange , resolution 1 ye.g. 0x00 = 0, 0x10 = 16, 0x7F = 127 y0x80 = 128, 0x81 = 129, 0x90 = ????, 0xC0 = ???? y0xF0 = ????, 0xFE = 254, 0xFF = 255 zSigned 8-bit integers -- 2’s complement yRange -128 to + 127, resolution 1 ye.g. 0x00 = 0, 0x10 = +16, 0x7F = +127 y0x80 = -128, 0x81 = = -127, 0x90 = ??? y0xF0 = ????, 0xFE = -2, 0xFF = -1

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 6 / 28 Floating Point in Binary Representation 20 (decimal) = 0x14 hex = % (binary) = % Normalize binary -- express as %1.frac * 2 N % = % * = % = % * 2 2 Sign = 0 Fraction part = Biased Exponent = 129 = % Stored as FP Number etc 0x40C =

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 7 / 28 Display Program Code -- Float 32-bit registers

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 8 / 28 Code displayed in Mixed Mode 32 bit registers 40 bit display Ultra High precision FP Note how FP looks like VERY LARGE integer No such instruction as F4 = Only R4 = WARNING --- F4 = 2 is the same as R4 = 2 and is DIFFERENT F4 = 2.0

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith -- 9 / 28 Need to learn to recognize zWhat do “integers” look like when they are displayed as “floats” zWhat do “floats” look like when displayed as “integers” yHappens when you pass a pointer to the start of an array and then treat the array incorrectly zI consider the following a BUG IN ASSEMBLER yF4 = 6 is actually the same as F4 = 3 * yFN = value does not exist -- only RN = value yMake sure that you add the decimal point!!!! y.byte4 array_of_FLOATS[] = { 2.8, 3, 3.2, 3.4}; NOT INTENDED AS A VERY SMALL VALUE

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Display Program Code -- Integer 32 BIT registers Note how integers look like VERY SMALL floats -- note integer has wrong values – 2 * 3 = 0 Top 32 bits means something

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Unexpected default integer representation z68k processor yDefault operations ySigned and unsigned integer representation z21k processor / Blackfin / TigerSHARC yDefault operations ySigned and unsigned integer representation of “fractional” values ySigned and unsigned integer “need to be switched on” zSee difference in multiplication

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Code displayed in Mixed Mode Q9 – What happens with Blackfin

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Proper Integer Coding sequence

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Bit meaning in 8-bit signed fractional number ^ ACTS AS IF “BINARY POINT” HERE Binary Pattern % = -1 * * * * * * * * 2 -7 Decimal Calculation = ( 0x93 / 128) = ( 0x80 + 0x13 ) / 128 = ( ) / 128 = / 128

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Signed fractional zInteger interpreted with a binary point just after the sign bit zUsing 32-bit values zSmallest value -1.0 zLargest almost = = ^-31 zSteps (accuracy)2^-31

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 68k equivalence -- 8-bit example zStandard number format yRange -128 to + 127, resolution 1 y0x0A+ 0x01 = 0x0B y% % = % zIn any given DSP algorithm it could be useful to scale input values so that we have an alternative number format where binary point is effectively placed between bit #3 and #4 yRange -8 to 7 7/8, resolution 1/8 y0xA0 + 0x10 = 0xB0 (Means 0xA.0, 0x1.0, 0xB.0) y% % = % zAddition supported in both number formats

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 68k equivalence -- 8-bit example zStandard number format yRange -128 to + 127, resolution 1 y0x0A * 0x01 = 0x0A y% * % = % zAlternative number format where binary point is placed between bit #3 and #4 yRange -8 to 7 7/8, resolution 1/8 y0xA.0 * 0x1.0 = 0x?? y% * % = % zMust now adjust by >> 8 to get correct answer. When SHARC in SSF format, the scaling occurs automatically

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Equivalent decimal calculation zAs done in grade 6 y-0.75 * yPerform 75 * 125 then adjust for 5 decimal places. y-9375 then adjust to give z68k multiplication was y0xA.0 * 0x1.0 yPerform 0xA0 * 0x10 then adjust for hex places y0xA00 then adjust to give 0xA.00

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Displayed as “signed fractional”

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 SHARC DIVISION APPEARS WEIRD TOO

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Actual SHARC division operations Note the parallel instructions

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Division is slow zInteger division on 68K cycles y60000 / 3 takes 70 cycles y60000 / 2 takes 70 cycles zInteger shift takes much less y60000 / 2 = >> 1 yASR #1, D0 (with D0 = 60000) takes 4 cycles y ASHIFT D0 BY -1 takes 1 cycle zCan we find an equivalent operation for floating point scaling (by 2, 4, 8, 16 etc.)?

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Signed Fractional -- ASHIFT of integer Works here but that’s cheating since SF format is an floating point interpretation of an integer format

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 SIGN BIT Binary Pattern of TRUE floats EXPONENT BITS FRACTIONAL BITS Floating point division is often SLOW DIVIDE BY 2, 4, 8, 16 fast with integers CAN ALSO MAKE FAST WITH FLOATS If you understand number representations

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Fast scaling -- Floats as Integers Differ in BEXP by 2 Differ in value by 4.0

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Complete Fast Scaling

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Nothing but a party trick! F8 = ; F0 = 4.0; F1 = F0 * F8; F2 = 2.0; F3 = F3 * F8; F4 = 0.0; F5 = F4 * F8; Since this processor has single cycle multiply operation R8 = -4; F0 = 4.0; F1 = SCALEB F0 BY R8; F2 = 2.0; F3 = SCALEB F2 BY R8; F4 = 0.0; F5 = SCALEB F4 BY R8; Works just like our code Advantage – this is a COMPUTE operation and NOT a MAC operation

4/17/2015 Number Representations -- SHARC ADSP21061 Copyright M. Smith / 28 Learnt today zNumber Representations are varied zMake sure you understand them zCan solve many coding errors by recognizing improper use of number representations -- Limitation in SHARC assembler for F4 = zSigned Fractional is default SHARC integer representation zUnderstanding Number Representations allows for that 1 in 1000 situation when somebody at a party likes to play with DSP processors.