Coding Theory. Networks and Embedded Software. Digital Circuits. by Wolfgang Neff

Size: px
Start display at page:

Download "Coding Theory. Networks and Embedded Software. Digital Circuits. by Wolfgang Neff"

Transcription

1 Coding Theory Networks and Embedded Software Digital Circuits by Wolfgang Neff

2 Coding (1) Basic concepts Information Knowledge about something Abstract concept (just in mind, can not be touched) Data Representation of information Signals on a medium (characters on paper) Coding Write down information Tree Coding Theory, W. Neff 2

3 Coding (2) Coding and communication are related Message Sender Encoding Channel Decoding Receiver Signal via Medium (e. g. Speech) Coding Theory, W. Neff 3

4 Coding (3) Coding and computer science are related IPO Model Input Encoding Processing Decoding Output Storage Input Encoding Processing Decoding Output Coding Theory, W. Neff 4

5 Coding (4) Coding maps the elements of two sets A := {,, } B:= {Car, Tree, House} Car Tree House Information Representation Coding Theory, W. Neff 5

6 Coding (5) Computers represent information by numbers Information Number Coding Theory, W. Neff 6

7 Coding (6) Example A door has the three states open, closed, locked The house has four doors We will code the state of the doors of the house Binary coding of the states of a door Hot one coding of the state of a door Binary coding of the state of the house I IV II III Coding Theory, W. Neff 7

8 Coding (7) Binary coding of the states of a door We need two bits to encode the state of the door State First bit Second Bit Open 0 0 Close 0 1 Locked 1 0 Unused 1 1 We need eight bits for the state of the house Door 1 Door 2 Door 3 Door Coding Theory, W. Neff 8

9 Coding (8) Hot one coding of the state of a door We use one bit per state of the door State First bit Second Bit Third Bit Open Close Locked We need twelve bits for the state of the house Door 1 Door 2 Door 3 Door Coding Theory, W. Neff 9

10 Coding (9) Direct coding A door has three states O: open C: closed L: locked Our house has 3 4 = 81 states We need seven bits to encode all states 2 7 > 81 There are many don tcare terms n Door I Door II Door III Door IV 0 O O O O 1 O O O C 2 O O O L 3 O O C O 4 O O C C 5 O O C L 6 O O L O 7 O O L C 8 O O L L 9 O C O O Coding Theory, W. Neff 10

11 Numeral Systems (1) Numeral systems encode numbers IIIII IIIII IIIII IIIII IIIII IIIII IIIII IIIII Information Decimal Representation XXV V X 五 二十五 十 Roman Representation Chinese Representation Coding Theory, W. Neff 11

12 Numeral Systems (2) Example: Decimal System Base: 10 (number of digits) Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 The value of a digit depends on its position Example 2012 dec = dec = dec = 2012 val (value) Coding Theory, W. Neff 12

13 Numeral Systems (3) Values of numeral representation in general a n a n 1 a 1 a 0 = n i=0 a i b i a i : the digit at position i b: the number of digits Example dec = i=0 a i 10 i = Coding Theory, W. Neff 13

14 Numeral Systems (4) Basic concepts Base: number of digits 10 (we use the decimal system as example) Digits: representation of the digits 0,1,2,3,4,5,6,7,8,9 Value of a representation 2012 dec = = 2012 val Range: number of possible values = blength of number 4 digits (0 9999) = 10 4 different values Coding Theory, W. Neff 14

15 Numeral Systems (5) Basic concepts (continued) Representation 2012 val = = 201 remainder = 20 remainder = 2 remainder = 0 remainder 2 Reading Direction The algorithm ends here A value of 2012 is represented by 2012 dec Coding Theory, W. Neff 15

16 Numeral Systems (6) The hexadecimal system Base: 16 Digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Value 2012 hex = val Range 4 digits (0 FFFF hex ) = 16 4 (65536) different values Coding Theory, W. Neff 16

17 Numeral Systems (7) The hexadecimal system (continued) Representation 2012 val = = 125 remainder 12 (C) = 7 remainder 13 (D) 7 16 = 0 remainder 7 A value of 2012 is represented by 7DC hex Coding Theory, W. Neff 17

18 Numeral Systems (8) The binary system Base: 2 Digits: 0,1 Value 1011 bin = val Range 4 digits ( bin ) = 2 4 (16) different values Coding Theory, W. Neff 18

19 Numeral Systems (9) The binary system (continued) Representation 57 val = 57 2 = 28 remainder = 14 remainder = 7 remainder = 3 remainder = 1 remainder = 0 remainder 1 A value of 57 is represented by bin Coding Theory, W. Neff 19

20 Binary Numbers (1) Computers use the binary system Because they are digital circuits Therefore they are based on Boolean algebra The binary digits are called bits Some groups of bits have special names Nibble (4 bits), byte (8 bits), word (16 bits or more) Data is encoded as binary numbers Numbers, text, images etc Coding Theory, W. Neff 20

21 Binary Numbers (2) Fixed-length binary numbers The length of binary numbers is limited The first and the last digit have a name Rightmost bit: LSB (Least Significant Bit 2 0 =1) Leftmost bit: MSB (Most Significant Bit 2 7 =128) Bit Value Number MSB LSB Coding Theory, W. Neff 21

22 Binary Numbers (3) Use exponential calculus to get the range 8 Bits: 2 8 = 256 values Range is Bits: 2 16 = = * = Range is Bits: 2 32 = = *1000*1000*4 4,000,000, = 4,294,967, Coding Theory, W. Neff 22

23 Binary Numbers (4) Nibbles (4 bits) can easily converted to hex Examples C D A 1110 E B 1111 F bin 00 hex bin BC hex bin 64 hex bin FF hex Coding Theory, W. Neff 23

24 Binary Numbers (5) Base64 coding uses 64 digits Used in internet communication Three bytes are encoded in four ASCII chars 1 st Byte 2 nd Byte 3 rd Byte st Character 2 nd Character 3 rd Character 4 th Character Coding Theory, W. Neff 24

25 Binary Numbers (6) The coding table of Base64 00 A 08 I 10 Q 18 Y 20 g 28 o 30 w B 09 J 11 R 19 Z 21 h 29 p 31 x C 0A K 12 S 1A a 22 i 2A q 32 y 3A 6 03 D 0B L 13 T 1B b 23 j 2B r 33 z 3B 7 04 E 0C M 14 U 1C c 24 k 2C s C 8 05 F 0D N 15 V 1D d 25 l 2D t D 9 06 G 0E O 16 W 1E e 26 m 2E u E + 07 H 0F P 17 X 1F f 27 n 2F v F / Coding Theory, W. Neff 25

26 Binary Numbers (7) Rapid conversion Bin Dec Write 1 above the LSB. Double until MSB is reached. Add all values where the digit is 1. Example: bin = = 179 dec Coding Theory, W. Neff 26

27 Binary Numbers (8) Rapid Conversion Dec Bin Double 1 until it is greater than the number to convert. Try to subtract these values. If it is possible the digit is 1 otherwise it is 0. Example: 179 dec = bin Coding Theory, W. Neff 27

28 Calculus (1) Binary Addition Same method as decimal addition Noteworthy facts: Leading Zeros Carry Overflow 1 st Number nd Number Carry Result Carry Leading Zero No Overflow Coding Theory, W. Neff 28

29 Calculus (2) Binary Addition Example Leading Zero Fixed bit length Bit Flag st Number nd Number Carry Result Carry An overflow is stored in the carry flag Coding Theory, W. Neff 29

30 Calculus (3) Binary Addition We encounter the following situations 1 st Bit nd Bit Carry Result dec bin Carry Result Coding Theory, W. Neff 30

31 Calculus (4) Binary Subtraction Subtraction works with borrowing Borrowed from next bit 1 st Bit bin dec nd Bit Borrow Result Coding Theory, W. Neff 31

32 Calculus (5) Binary Multiplication Same method as decimal multiplication Example: 13*5 = 65 = bin * Coding Theory, W. Neff 32

33 Calculus (6) Shifting A left shift doubles the value of the number *2 = 10 Left Shift A right shift halves the value of the number 10 / 2 = Right Shift Coding Theory, W. Neff 33

34 Calculus (6) Binary Division Same method as decimal division. Sometimes replaced by shifting because of speed. Example: 2,54*15 = 254*15/100 = 38 Multiply with an appropriate power of two (2 7 =128) 2,54 = 2,54*2 7 / 2 7 = 325 / 2 7 Multiply with numerator and then shift 2,54*15 = 325*15 / 2 7 = 4875 / 2 7 = 4875 >> 7 = 38 This is only an approximation but may be very fast» 254/100 = 2,540 vs. 325/128 = 2,539» E. g. AVR: with division 250 cycles vs. 16 cycles with shift Coding Theory, W. Neff 34

35 Signed Numbers (1) Fixed-length binary numbers have a range. If we exceed the range we restart from zero. Therefore the number ray becomes a circle. length = 3 bits Coding Theory, W. Neff 35

36 Signed Numbers (2) We get negative numbers if we go beyond zero. 2 n numbers 2 n-1 numbers 2 n-1 numbers Coding Theory, W. Neff 36

37 Signed Numbers (3) We have to sacrifice positive numbers to get negative numbers. Negative numbers have its MSB is set. The range of negative number is Positive number range: n-1-1 Negative number range: n-1 n: bit length of number Coding Theory, W. Neff 37

38 Signed Numbers (4) Two s complement Used to negate a number Complement all bits Add a value of one Number Complement Carry Result Coding Theory, W. Neff 38

39 Signed Numbers (5) Rapid conversion Bin signed Dec Negate the MSB Add the rest Example: B3 hex = -77 dec bin = = -77 dec Coding Theory, W. Neff 39

40 Signed Numbers (6) Rapid conversion negative Dec Bin Add number to range Convert result to binary Example: -77 dec = B3 hex Bit length = 8 Range: 2 8 = = dec = bin = B3 hex Coding Theory, W. Neff 40

41 Fixed-Point Numbers (1) Fixed-point numbers are numeral systems with a negative index: a n a n 1 a 1 a 0. a 1 a m = n i= m a i b i There are m positions after the decimal point There are n+1 positions before the decimal point Coding Theory, W. Neff 41

42 Fixed-Point Numbers (2) Example: a base 16 fixed-point number Number: hex Value: hex = / / You have to round to preserve the number of positions after the decimal point Coding Theory, W. Neff 42

43 Fixed-Point Numbers (2) Example: a base 16 fixed-point number Representation = = 20 hex Division by 1 / = = 1 remainder = 1 remainder = 14 remainder = 11 remainder 0.52 Stop when you have got enough positions The value of is 20.11EB hex Round-off errors are almost inevitable Reading Direction Coding Theory, W. Neff 43

44 Fixed-Point Numbers (3) Binary fixed-point numbers Notation of binary fractional numbers s(n.m): signed binary fractional - n bits before the decimal point and m bits after. MSB is sign bit. u(n.m): unsigned binary fractional n bits before the decimal point and m bits after it. No sign bit. Binary fractional calculus d(n.m) + d(n.m) = d(n+1.m) = d(n.m) and carry flag d(n 1.m 1 ) d(n 2.m 2 ) = d(n 1 +n 2.m 1 +m 2 ) Coding Theory, W. Neff 44

45 Fixed-Point Numbers (4) d(1.n) binary fractional numbers often used in digital signal processing (DSP) Multiplication modifies the number format d(1.n) d(1.n) = d(2.2 n) A left shift is necessary to obtain d(1.2 n+1) An overflow might occur indicated by the carry flag Some microcontroller have special instructions AVR: FMUL Fractional Multiply Unsigned s(1.7) s(1.7) s(1.15) Coding Theory, W. Neff 45

46 Fixed-Point Numbers (5) Rapid conversion d(n,m) Dec Start with 1 at the decimal point. Double it until you reach the MSB. Half it until you reach the LSB. Example: s(1.7) = B3 s(1.7) -1 1 / 2 1 / 4 1 / 8 1 / 16 1 / 32 1 / 64 1 / B3 s(1.7) = / / / / 128 = dec Coding Theory, W. Neff 46

47 Fixed-Point Numbers (6) Rapid Conversion Dec Bin Choose a binary fractional format and write its values above the positions. Try to subtract these values. If it is possible then the digit is 1 otherwise it is 0. Example: dec = s(1.7) / 2 1 / 4 1 / 8 1 / 16 1 / 32 1 / 64 1 / Coding Theory, W. Neff 47

48 Fixed-Point Numbers (7) Example: sin(0 2π) in s(1.7) fractional binaries n x 0, sin(x) s(1.7) 00 hex 30 hex 5A hex 76 hex 7F hex 76 hex 5A hex 30 hex 1.0 is not in the range of s(1.7). We use 7E instead. This is called saturation. n x sin(x) s(1.7) 00 hex CF hex A5 hex 89 hex 80 hex 89 hex A5 hex CF hex Coding Theory, W. Neff 48

49 Floating-Point Numbers (1) Do not have a fixed decimal point position. Are expressed by a mantissa and an exponent. Are usually normalized: Only one digit before the decimal point dec dec 10 1 (normalized) Floating-point numbers are standardized: IEEE 754: Standard for Floating-Point Arithmetic Commonly used: single and double precision Coding Theory, W. Neff 49

50 Floating-Point Numbers (2) IEEE 754 floating-point binary numbers Format of a half precision floating-point 1 st Byte 2 nd Byte S C C C C C F F F F F F F F F F Sign Character Fraction Value of a half precision floating-point = (-1) S Mantissa 2 Exponent Bias = 15 Exponent = Character Bias ( ) Character and reserved for ± and NaN (Not a Number) Mantissa = 1.Fraction bin Coding Theory, W. Neff 50

51 Floating-Point Numbers (3) Example: value of half precision B248 hex Value: 1 st Byte 2 nd Byte S C C C C C F F F F F F F F F F Exponent = Character - Bias = = 1 Mantissa = 1. + Fraction = = 1, Value = (-1) S Mantissa 2 Exponent = -1 1, Half precision B248 hex = dec Coding Theory, W. Neff 51

52 Floating-Point Numbers (4) Example: π as a half precision binary number Representation = bin bin 2 1 Character = Exponent + Bias = = 16 = bin Fraction = bin 1 st Byte 2 nd Byte S C C C C C F F F F F F F F F F π = 4248 hex represented as a half precision binary Coding Theory, W. Neff 52

53 Floating-Point Numbers (5) Characteristics of IEEE 754 floating-points Characteristic Half precision Single precision Double precision Size 16 bit 32 bit 64 bit Character 5 bit 8 bit 11 bit Fraction 10 bit 23 bit 52 bit Exponent Bias Coding Theory, W. Neff 53

54 Characters (1) Characters are mapped to codes and fonts Coding C A Ä ð B A B C Ä A B Fonts Fonts describe the graphic appearance of characters Character C Coding Theory, W. Neff 54

55 Characters (2) Characters are encoded by numbers. Characters are displayed by fonts. The mapping need not be total. There can be characters without code There can be characters not present in a font There are many different fonts. Times New Roman Harlow Solid Italic Coding Theory, W. Neff 55

56 Characters (3) ASCII: the ancestor American Standard Code for Information Interchange Published by ASA in 1963 Uses 7 bits per character Contains Control characters Letters and Numbers Punctuation and special characters Coding Theory, W. Neff 56

57 Characters (4) The ASCII code table ASCII Lower Hex Digit A B C D E F 0 NUL SOH STX ETX EOF ENQ ACK BEL BS HT LF VT FF CR SO SI Higher Hex Digit 1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2! " # $ % & ' ( ) * +, -. / : ; < = >? A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ \ ] ^ _ 6 ` a b c d e f g h i j k l m n o 7 p q r s t u v w x y z { } ~ DEL Coding Theory, W. Neff 57

58 Characters (5) Latin-1: One nation one character set Deficiencies of ASCII Suitable for English, only Other languages use additional symbols Only 7 bits of a byte used ISO 8859 Uses all 8 bits of a byte for coding 128 additional symbols One standard per region -1: Western European -2: Central European -7: Latin/Greek -11: Latin/Thai Coding Theory, W. Neff 58

59 Characters (6) The ISO code table: Latin 1 Latin Higher Hex Digit 8 9 Lower Hex Digit A B C D E F same as ASCII unused A NBSP ª «B ± ² ³ µ ¹ º» ¼ ½ ¾ C À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï D Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß E à á â ã ä å æ ç è é ê ë ì í î ï F ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ Coding Theory, W. Neff 59

60 Characters (7) Unicode: One code for all nations Consistent encoding of all writing system Comprises modern and historic scripts Consists of more than characters Uses 32 bits for coding Standardized as ISO/IEC Special formats for storage (UTF) Coding Theory, W. Neff 60

61 Characters (8) Unicode is or organized in planes. Diacritics and Ligatures à, å, ä, æ Non-Latin writing systems العربية Arabic: Logographic writing system Chinese: 汉语 Special purpose characters Mathematics:,,,, ±,, Coding Theory, W. Neff 61

62 Characters (9) Example: Greek and Coptic (U+0370-U+03FF) Code ΐ Α Β Γ Δ Ε Ζ Η U+0390: ΐ Greek small litter iota with U+0391: Α Greek capital letter alpha U+0392: Β Greek capital letter beta U+0393: Γ Greek capital letter gamma U+0394: Δ Greek capital letter delta Coding Theory, W. Neff 62

63 Characters (10) Unicode Transformation Format Used to store and process Unicode characters UTF-16 Used in Windows, OS X, Java,.Net UTF-8 Used to store Unicode characters in files Aims to reduce the size of Unicode files Variable length 8 bit code ASCII files are valid UTF-8 files Coding Theory, W. Neff 63

64 Characters (11) UTF-8 Coding procedure Unicode Character U+ xxxx xyyy yzzz zzzz If each x and each y is 0 The code is 0zzz zzzz (n. b. this is the ASCI code) If each x is 0 The code is 110y yyyz 10zz zzzz Otherwise The code is 1110 xxxx 10xy yyyz 10zz zzzz Coding Theory, W. Neff 64

65 Characters (12) UTF-8 Coding examples y U Each x and each y is 0 y ä U+00E Each x is 0 ä U+20AC Coding Theory, W. Neff 65

66 Important Expressions (1) numbering system digit range decimal system binary system hexadecimal system bit length MSB / LSB Zahlensystem Ziffer Wertebereich Dezimalsystem Binärsystem Hexadezimalsystem Bitbreite MSB / LSB Coding Theory, W. Neff 66

67 Important Expressions (2) carry leading zero overflow two's Complement floating point number character encoding scheme internationalization (i18n) Übertrag Führende Null Überlauf Zweikomplement Gleitkommazahl Zeichen Kodierungsschema Internationalisierung Coding Theory, W. Neff 67

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS Chapter 1. 1.1. INTRODUCTION Digital computers have brought about the information age that we live in today. Computers are important tools because they can locate and process enormous amounts of information

More information

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes Multiple-byte data CMSC 313 Lecture 03 big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes UMBC, CMSC313, Richard Chang 4-5 Chapter

More information

Data Representation and Binary Arithmetic. Lecture 2

Data Representation and Binary Arithmetic. Lecture 2 Data Representation and Binary Arithmetic Lecture 2 Computer Data Data is stored as binary; 0 s and 1 s Because two-state ( 0 & 1 ) logic elements can be manufactured easily Bit: binary digit (smallest

More information

Chapter 2 Number System

Chapter 2 Number System Chapter 2 Number System Embedded Systems with ARM Cortext-M Updated: Tuesday, January 16, 2018 What you should know.. Before coming to this class Decimal Binary Octal Hex 0 0000 00 0x0 1 0001 01 0x1 2

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012 CMSC 33 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 2, FALL 22 TOPICS TODAY Bits of Memory Data formats for negative numbers Modulo arithmetic & two s complement Floating point formats

More information

Chapter 3. Information Representation

Chapter 3. Information Representation Chapter 3 Information Representation Instruction Set Architecture APPLICATION LEVEL HIGH-ORDER LANGUAGE LEVEL ASSEMBLY LEVEL OPERATING SYSTEM LEVEL INSTRUCTION SET ARCHITECTURE LEVEL 3 MICROCODE LEVEL

More information

CPS 104 Computer Organization and Programming Lecture-2 : Data representations,

CPS 104 Computer Organization and Programming Lecture-2 : Data representations, CPS 104 Computer Organization and Programming Lecture-2 : Data representations, Sep. 1, 1999 Dietolf Ramm http://www.cs.duke.edu/~dr/cps104.html CPS104 Lec2.1 GK&DR Fall 1999 Data Representation Computers

More information

Fundamentals of Programming (C)

Fundamentals of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamentals of Programming (C) Group 8 Lecturer: Vahid Khodabakhshi Lecture Number Systems Department of Computer Engineering Outline Numeral Systems

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013 TOPICS TODAY Bits of Memory Data formats for negative numbers Modulo arithmetic & two s complement Floating point

More information

ASCII Code - The extended ASCII table

ASCII Code - The extended ASCII table ASCII Code - The extended ASCII table ASCII, stands for American Standard Code for Information Interchange. It's a 7-bit character code where every single bit represents a unique character. On this webpage

More information

Number System (Different Ways To Say How Many) Fall 2016

Number System (Different Ways To Say How Many) Fall 2016 Number System (Different Ways To Say How Many) Fall 2016 Introduction to Information and Communication Technologies CSD 102 Email: mehwish.fatima@ciitlahore.edu.pk Website: https://sites.google.com/a/ciitlahore.edu.pk/ict/

More information

Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Chapter 2 Bits, Data Types, and Operations How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of electrons Easy to recognize

More information

Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Chapter Bits, Data Types, and Operations How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of electrons Easy to recognize two

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 2 Number Systems & Arithmetic Lecturer : Ebrahim Jahandar Some Parts borrowed from slides by IETC1011-Yourk University Common Number Systems System Base Symbols Used

More information

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras Numbers and Computers Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras 1 Think of a number between 1 and 15 8 9 10 11 12 13 14 15 4 5 6 7 12 13 14 15 2 3 6 7 10 11 14 15

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012 ANNOUNCEMENTS TA Office Hours (ITE 334): Genaro Hernandez, Jr. Mon 10am 12noon Roshan Ghumare Wed 10am 12noon Prof.

More information

Number Systems Base r

Number Systems Base r King Fahd University of Petroleum & Minerals Computer Engineering Dept COE 2 Fundamentals of Computer Engineering Term 22 Dr. Ashraf S. Hasan Mahmoud Rm 22-44 Ext. 724 Email: ashraf@ccse.kfupm.edu.sa 3/7/23

More information

Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Chapter 2 Bits, Data Types, and Operations Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University How do we represent data in a computer?!

More information

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums plc numbers - 3. 3. NUMBERS AND DATA Topics: Number bases; binary, octal,, hexa Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

More information

DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes. Error Detection Codes

DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes. Error Detection Codes 1 DATA REPRESENTATION Data Types Complements Fixed Point Representations Floating Point Representations Other Binary Codes Error Detection Codes 2 Data Types DATA REPRESENTATION Information that a Computer

More information

Oberon Data Types. Matteo Corti. December 5, 2001

Oberon Data Types. Matteo Corti. December 5, 2001 Oberon Data Types Matteo Corti corti@inf.ethz.ch December 5, 2001 1 Introduction This document is aimed at students without any previous programming experience. We briefly describe some data types of the

More information

Source coding and compression

Source coding and compression Computer Mathematics Week 5 Source coding and compression College of Information Science and Engineering Ritsumeikan University last week binary representations of signed numbers sign-magnitude, biased

More information

2a. Codes and number systems (continued) How to get the binary representation of an integer: special case of application of the inverse Horner scheme

2a. Codes and number systems (continued) How to get the binary representation of an integer: special case of application of the inverse Horner scheme 2a. Codes and number systems (continued) How to get the binary representation of an integer: special case of application of the inverse Horner scheme repeated (integer) division by two. Example: What is

More information

Number Systems II MA1S1. Tristan McLoughlin. November 30, 2013

Number Systems II MA1S1. Tristan McLoughlin. November 30, 2013 Number Systems II MA1S1 Tristan McLoughlin November 30, 2013 http://en.wikipedia.org/wiki/binary numeral system http://accu.org/index.php/articles/18 http://www.binaryconvert.com http://en.wikipedia.org/wiki/ascii

More information

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES Structure 2.0 Introduction 2.1 Unit Objectives 2.2 Number Systems 2.3 Bits and Bytes 2.4 Binary Number System 2.5 Decimal Number System 2.6 Octal Number System

More information

Under the Hood: Data Representation. Computer Science 104 Lecture 2

Under the Hood: Data Representation. Computer Science 104 Lecture 2 Under the Hood: Data Representation Computer Science 104 Lecture 2 Admin Piazza, Sakai Up Everyone should have access Homework 1 Posted Due Feb 6 PDF or Plain Text Only: No Word or RTF Recommended: Learn

More information

Bits and Bytes. Data Representation. A binary digit or bit has a value of either 0 or 1; these are the values we can store in hardware devices.

Bits and Bytes. Data Representation. A binary digit or bit has a value of either 0 or 1; these are the values we can store in hardware devices. Bits and Bytes 1 A binary digit or bit has a value of either 0 or 1; these are the values we can store in hardware devices. A byte is a sequence of 8 bits. A byte is also the fundamental unit of storage

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Pradip Vallathol and Junaid Khalid Midterm Examination 1 In Class (50 minutes) Friday, September

More information

Positional Number System

Positional Number System Positional Number System A number is represented by a string of digits where each digit position has an associated weight. The weight is based on the radix of the number system. Some common radices: Decimal.

More information

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Junaid Khalid and Pradip Vallathol Midterm Examination 1 In Class (50 minutes) Friday, September

More information

OOstaExcel.ir. J. Abbasi Syooki. HTML Number. Device Control 1 (oft. XON) Device Control 3 (oft. Negative Acknowledgement

OOstaExcel.ir. J. Abbasi Syooki. HTML Number. Device Control 1 (oft. XON) Device Control 3 (oft. Negative Acknowledgement OOstaExcel.ir J. Abbasi Syooki HTML Name HTML Number دهدهی ا کتال هگزاد سیمال باینری نشانه )کاراکتر( توضیح Null char Start of Heading Start of Text End of Text End of Transmission Enquiry Acknowledgment

More information

EE 109 Unit 3. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

EE 109 Unit 3. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL 3. 3. EE 9 Unit 3 Binary Representation Systems ANALOG VS. DIGITAL 3.3 3. Analog vs. Digital The analog world is based on continuous events. Observations can take on any (real) value. The digital world

More information

Unit 3. Analog vs. Digital. Analog vs. Digital ANALOG VS. DIGITAL. Binary Representation

Unit 3. Analog vs. Digital. Analog vs. Digital ANALOG VS. DIGITAL. Binary Representation 3.1 3.2 Unit 3 Binary Representation ANALOG VS. DIGITAL 3.3 3.4 Analog vs. Digital The analog world is based on continuous events. Observations can take on (real) any value. The digital world is based

More information

Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Chapter 2 Bits, Data Types, and Operations Original slides from Gregory Byrd, North Carolina State University Modified by Chris Wilcox, S. Rajopadhye Colorado State University How do we represent data

More information

Chemistry Hour Exam 2

Chemistry Hour Exam 2 Chemistry 838 - Hour Exam 2 Fall 2003 Department of Chemistry Michigan State University East Lansing, MI 48824 Name Student Number Question Points Score 1 15 2 15 3 15 4 15 5 15 6 15 7 15 8 15 9 15 Total

More information

Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Chapter 2 Bits, Data Types, and Operations Computer is a binary digital system. Digital system: finite number of symbols Binary (base two) system: has two states: 0 and 1 Basic unit of information is the

More information

Number Representations

Number Representations Simple Arithmetic [Arithm Notes] Number representations Signed numbers Sign-magnitude, ones and twos complement Arithmetic Addition, subtraction, negation, overflow MIPS instructions Logic operations MIPS

More information

5/17/2009. Digitizing Discrete Information. Ordering Symbols. Analog vs. Digital

5/17/2009. Digitizing Discrete Information. Ordering Symbols. Analog vs. Digital Chapter 8: Bits and the "Why" of Bytes: Representing Information Digitally Digitizing Discrete Information Fluency with Information Technology Third Edition by Lawrence Snyder Copyright 2008 Pearson Education,

More information

3.1. Unit 3. Binary Representation

3.1. Unit 3. Binary Representation 3.1 Unit 3 Binary Representation ANALOG VS. DIGITAL 3.2 3.3 Analog vs. Digital The analog world is based on continuous events. Observations can take on (real) any value. The digital world is based on discrete

More information

EE 109 Unit 2. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

EE 109 Unit 2. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL EE 9 Unit Binary Representation Systems ANALOG VS. DIGITAL Analog vs. Digital The analog world is based on continuous events. Observations can take on any (real) value. The digital world is based on discrete

More information

MACHINE LEVEL REPRESENTATION OF DATA

MACHINE LEVEL REPRESENTATION OF DATA MACHINE LEVEL REPRESENTATION OF DATA CHAPTER 2 1 Objectives Understand how integers and fractional numbers are represented in binary Explore the relationship between decimal number system and number systems

More information

Number Systems for Computers. Outline of Introduction. Binary, Octal and Hexadecimal numbers. Issues for Binary Representation of Numbers

Number Systems for Computers. Outline of Introduction. Binary, Octal and Hexadecimal numbers. Issues for Binary Representation of Numbers Outline of Introduction Administrivia What is computer architecture? What do computers do? Representing high level things in binary Data objects: integers, decimals, characters, etc. Memory locations (We

More information

Exercises Software Development I. 03 Data Representation. Data types, range of values, internal format, literals. October 22nd, 2014

Exercises Software Development I. 03 Data Representation. Data types, range of values, internal format, literals. October 22nd, 2014 Exercises Software Development I 03 Data Representation Data types, range of values, ernal format, literals October 22nd, 2014 Software Development I Wer term 2013/2014 Priv.-Doz. Dipl.-Ing. Dr. Andreas

More information

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. Digital Logic 1 Data Representations 1.1 The Binary System The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. The system we

More information

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1 IT 1204 Section 2.0 Data Representation and Arithmetic 2009, University of Colombo School of Computing 1 What is Analog and Digital The interpretation of an analog signal would correspond to a signal whose

More information

Binary Numbers. The Basics. Base 10 Number. What is a Number? = Binary Number Example. Binary Number Example

Binary Numbers. The Basics. Base 10 Number. What is a Number? = Binary Number Example. Binary Number Example The Basics Binary Numbers Part Bit of This and a Bit of That What is a Number? Base Number We use the Hindu-Arabic Number System positional grouping system each position represents a power of Binary numbers

More information

EE 109 Unit 2. Binary Representation Systems

EE 109 Unit 2. Binary Representation Systems EE 09 Unit 2 Binary Representation Systems ANALOG VS. DIGITAL 2 3 Analog vs. Digital The analog world is based on continuous events. Observations can take on (real) any value. The digital world is based

More information

Inf2C - Computer Systems Lecture 2 Data Representation

Inf2C - Computer Systems Lecture 2 Data Representation Inf2C - Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack

More information

The Binary Number System

The Binary Number System The Binary Number System Robert B. Heckendorn University of Idaho August 24, 2017 Numbers are said to be represented by a place-value system, where the value of a symbol depends on where it is... its place.

More information

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

More information

ASSIGNMENT 5 TIPS AND TRICKS

ASSIGNMENT 5 TIPS AND TRICKS ASSIGNMENT 5 TIPS AND TRICKS linear-feedback shift registers Java implementation a simple encryption scheme http://princeton.edu/~cos26 Last updated on /26/7 : PM Goals OOP: implement a data type; write

More information

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation George Tsiknis University of British Columbia Department of Computer Science Winter Term 2, 2015-2016 Last updated: 04/04/2016

More information

EXPERIMENT 8: Introduction to Universal Serial Asynchronous Receive Transmit (USART)

EXPERIMENT 8: Introduction to Universal Serial Asynchronous Receive Transmit (USART) EXPERIMENT 8: Introduction to Universal Serial Asynchronous Receive Transmit (USART) Objective: Introduction To understand and apply USART command for sending and receiving data Universal Serial Asynchronous

More information

UTF and Turkish. İstinye University. Representing Text

UTF and Turkish. İstinye University. Representing Text Representing Text Representation of text predates the use of computers for text Text representation was needed for communication equipment One particular commonly used communication equipment was teleprinter

More information

Fundamental Data Types

Fundamental Data Types Fundamental Data Types Lecture 4 Sections 2.7-2.10 Robb T. Koether Hampden-Sydney College Mon, Sep 3, 2018 Robb T. Koether (Hampden-Sydney College) Fundamental Data Types Mon, Sep 3, 2018 1 / 25 1 Integers

More information

EXPERIMENT 7: Introduction to Universal Serial Asynchronous Receive Transmit (USART)

EXPERIMENT 7: Introduction to Universal Serial Asynchronous Receive Transmit (USART) EXPERIMENT 7: Introduction to Universal Serial Asynchronous Receive Transmit (USART) Objective: To understand and apply USART command for sending and receiving data Introduction Universal Serial Asynchronous

More information

Representing Characters and Text

Representing Characters and Text Representing Characters and Text cs4: Computer Science Bootcamp Çetin Kaya Koç cetinkoc@ucsb.edu Çetin Kaya Koç http://koclab.org Winter 2018 1 / 28 Representing Text Representation of text predates the

More information

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar Data Representation COE 30 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals Presentation Outline Positional Number

More information

Simple Data Types in C. Alan L. Cox

Simple Data Types in C. Alan L. Cox Simple Data Types in C Alan L. Cox alc@rice.edu Objectives Be able to explain to others what a data type is Be able to use basic data types in C programs Be able to see the inaccuracies and limitations

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted

More information

CHW 261: Logic Design

CHW 261: Logic Design CHW 261: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed14 http://bu.edu.eg/staff/ahmedshalaby14# Slide 1 Slide 2 Slide 3 Digital Fundamentals CHAPTER

More information

Experiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program.

Experiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program. Experiment 3 Introduction: In this experiment the students are exposed to the structure of an assembly language program and the definition of data variables and constants. Objectives: Assembly language

More information

Number System. Introduction. Decimal Numbers

Number System. Introduction. Decimal Numbers Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

More information

Module 2: Computer Arithmetic

Module 2: Computer Arithmetic Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N

More information

Data Representa5on. CSC 2400: Computer Systems. What kinds of data do we need to represent?

Data Representa5on. CSC 2400: Computer Systems. What kinds of data do we need to represent? CSC 2400: Computer Systems Data Representa5on What kinds of data do we need to represent? - Numbers signed, unsigned, integers, floating point, complex, rational, irrational, - Text characters, strings,

More information

Data Representa5on. CSC 2400: Computer Systems. What kinds of data do we need to represent?

Data Representa5on. CSC 2400: Computer Systems. What kinds of data do we need to represent? CSC 2400: Computer Systems Data Representa5on What kinds of data do we need to represent? - Numbers signed, unsigned, integers, floating point, complex, rational, irrational, - Text characters, strings,

More information

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc.

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc. 9 February 2011 CSE-1520R Test #1 [B4] p. 1 of 8 CSE-1520R Test #1 Sur / Last Name: Given / First Name: Student ID: Instructor: Parke Godfrey Exam Duration: 45 minutes Term: Winter 2011 The exam is closed

More information

COMP2611: Computer Organization. Data Representation

COMP2611: Computer Organization. Data Representation COMP2611: Computer Organization Comp2611 Fall 2015 2 1. Binary numbers and 2 s Complement Numbers 3 Bits: are the basis for binary number representation in digital computers What you will learn here: How

More information

l l l l l l l Base 2; each digit is 0 or 1 l Each bit in place i has value 2 i l Binary representation is used in computers

l l l l l l l Base 2; each digit is 0 or 1 l Each bit in place i has value 2 i l Binary representation is used in computers 198:211 Computer Architecture Topics: Lecture 8 (W5) Fall 2012 Data representation 2.1 and 2.2 of the book Floating point 2.4 of the book Computer Architecture What do computers do? Manipulate stored information

More information

COMP2121: Microprocessors and Interfacing. Number Systems

COMP2121: Microprocessors and Interfacing. Number Systems COMP2121: Microprocessors and Interfacing Number Systems http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 2, 2017 1 1 Overview Positional notation Decimal, hexadecimal, octal and binary Converting

More information

Chapter 7. Binary, octal and hexadecimal numbers

Chapter 7. Binary, octal and hexadecimal numbers Chapter 7. Binary, octal and hexadecimal numbers This material is covered in the books: Nelson Magor Cooke et al, Basic mathematics for electronics (7th edition), Glencoe, Lake Forest, Ill., 1992. [Hamilton

More information

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc.

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc. 9 February 2011 CSE-1520R Test #1 [7F] w/ answers p. 1 of 8 CSE-1520R Test #1 Sur / Last Name: Given / First Name: Student ID: Instructor: Parke Godfrey Exam Duration: 45 minutes Term: Winter 2011 The

More information

BINARY SYSTEM. Binary system is used in digital systems because it is:

BINARY SYSTEM. Binary system is used in digital systems because it is: CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

More information

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University. Data Representation ti and Arithmetic for Computers Rui Wang, Assistant professor Dept. of Information and Communication Tongji University it Email: ruiwang@tongji.edu.cn Questions What do you know about

More information

Unit 3, Lesson 2 Data Types, Arithmetic,Variables, Input, Constants, & Library Functions. Mr. Dave Clausen La Cañada High School

Unit 3, Lesson 2 Data Types, Arithmetic,Variables, Input, Constants, & Library Functions. Mr. Dave Clausen La Cañada High School Unit 3, Lesson 2 Data Types, Arithmetic,Variables, Input, Constants, & Library Functions Mr. Dave Clausen La Cañada High School Vocabulary Variable- A variable holds data that can change while the program

More information

Do not start the test until instructed to do so!

Do not start the test until instructed to do so! Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices

More information

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation Data Representation II CMSC 313 Sections 01, 02 The conversions we have so far presented have involved only unsigned numbers. To represent signed integers, computer systems allocate the high-order bit

More information

J2 LCM Customer Display. Manual

J2 LCM Customer Display. Manual J2 LCM Customer Display Manual July 2012 Contents LCM Customer Display... 3 Overview... 3 Customer Display Configureation... 4 Port Settings... 4 CD Settings... 5 Emulation Mode... 5 Character Sets...

More information

COMP Overview of Tutorial #2

COMP Overview of Tutorial #2 COMP 1402 Winter 2008 Tutorial #2 Overview of Tutorial #2 Number representation basics Binary conversions Octal conversions Hexadecimal conversions Signed numbers (signed magnitude, one s and two s complement,

More information

void mouseclicked() { // Called when the mouse is pressed and released // at the same mouse position }

void mouseclicked() { // Called when the mouse is pressed and released // at the same mouse position } Review Commenting your code Random numbers and printing messages mousex, mousey void setup() & void draw() framerate(), loop(), noloop() Arcs, curves, bézier curves, beginshape/endshape Example Sketches

More information

UNIT 7A Data Representation: Numbers and Text. Digital Data

UNIT 7A Data Representation: Numbers and Text. Digital Data UNIT 7A Data Representation: Numbers and Text 1 Digital Data 10010101011110101010110101001110 What does this binary sequence represent? It could be: an integer a floating point number text encoded with

More information

Imperial College London Department of Computing

Imperial College London Department of Computing Imperial College London Department of Computing Architecture SELF-STUDY NOTES January 2018 Integers and Characters (1) Self-Study Welcome to the Computer Architecture course. These notes cover basic topics

More information

Hardware. ( Not so hard really )

Hardware. ( Not so hard really ) Hardware ( Not so hard really ) Introduction to Computers What is a computer? Why use a computer anyway? Do they have limitations? What s next? A bit of history Mechanical Early 1614 1643 1673 Abacus Slide

More information

CS341 *** TURN OFF ALL CELLPHONES *** Practice NAME

CS341 *** TURN OFF ALL CELLPHONES *** Practice NAME CS341 *** TURN OFF ALL CELLPHONES *** Practice Final Exam B. Wilson NAME OPEN BOOK / OPEN NOTES: I GIVE PARTIAL CREDIT! SHOW ALL WORK! 1. Processor Architecture (20 points) a. In a Harvard architecture

More information

Representing Things With Bits

Representing Things With Bits Representing Things With Bits Introduction I said above, that what a bit pattern meant depended upon the context. We often want to represent things like characters and numbers in a bit pattern so that

More information

Chapter 2. Data Representation in Computer Systems

Chapter 2. Data Representation in Computer Systems Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

More information

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column 1's column 10's column 100's column 1000's column 1's column 2's column 4's column 8's column Number Systems Decimal numbers 5374 10 = Binary numbers 1101 2 = Chapter 1 1's column 10's column 100's

More information

Digital Representation

Digital Representation Special guests today: Informatics students: Benji Schwartz-Gilbert Ryan Musgrave DevynJones Announcements Why is BYTE spelled with a Y? Why "BYTE" The Engineers at IBM were looking for a word for a quantity

More information

Do not start the test until instructed to do so!

Do not start the test until instructed to do so! Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices

More information

Chapter 8. Characters and Strings

Chapter 8. Characters and Strings Chapter 8 Characters and s OJECTIVES After you have read and studied this chapter, you should be able to Declare and manipulate data of the char data type. Write string processing programs using and uffer

More information

Introduction to Informatics

Introduction to Informatics Introduction to Informatics Lecture : Encoding Numbers (Part II) Readings until now Lecture notes Posted online @ http://informatics.indiana.edu/rocha/i The Nature of Information Technology Modeling the

More information

PJ-600 Series Printer ESC/P Command Reference

PJ-600 Series Printer ESC/P Command Reference PJ-600 Series Printer ESC/P Command Reference Version 1.00 Model Name: PJ-622/623/662/663 Brother Industries, Ltd. 1 Machine Model: PJ-622/623/662/663 IMPORTANT - PLEASE READ CAREFULLY This

More information

Variables and data types

Variables and data types Programming with Python Module 1 Variables and data types Theoretical part Contents 1 Module overview 4 2 Writing computer programs 4 2.1 Computer programs consist of data and instructions......... 4 2.2

More information

Representing Characters, Strings and Text

Representing Characters, Strings and Text Çetin Kaya Koç http://koclab.cs.ucsb.edu/teaching/cs192 koc@cs.ucsb.edu Çetin Kaya Koç http://koclab.cs.ucsb.edu Fall 2016 1 / 19 Representing and Processing Text Representation of text predates the use

More information

Chapter 1. Hardware. Introduction to Computers and Programming. Chapter 1.2

Chapter 1. Hardware. Introduction to Computers and Programming. Chapter 1.2 Chapter Introduction to Computers and Programming Hardware Chapter.2 Hardware Categories Input Devices Process Devices Output Devices Store Devices /2/27 Sacramento State - CSc A 3 Storage Devices Primary

More information

Do not start the test until instructed to do so!

Do not start the test until instructed to do so! Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices

More information

AutoLISP Module 6 Competency Test No.1

AutoLISP Module 6 Competency Test No.1 AutoCAD Self-paced ecourse AutoLISP Module 6 Competency Test No.1 Learning Outcomes When you have completed this module, you will be able to: 1 Complete a written exam and write an AutoLISP program on

More information

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

More information

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

More information

Data Representations & Arithmetic Operations

Data Representations & Arithmetic Operations Data Representations & Arithmetic Operations Hiroaki Kobayashi 7/13/2011 7/13/2011 Computer Science 1 Agenda Translation between binary numbers and decimal numbers Data Representations for Integers Negative

More information