1 / 23

EGR 270 Fundamentals of Computer Engineering

Chapter 1 EGR 270 – Fundamentals of Computer Engineering. 1. EGR 270 Fundamentals of Computer Engineering. Reading Assignment: Chapter 1 in Logic and Computer Design Fundamentals, 4 th Edition by Mano. Syllabus Office Hours Web page.

sinjin
Télécharger la présentation

EGR 270 Fundamentals of Computer Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 1 EGR 270Fundamentals of Computer Engineering Reading Assignment: Chapter 1 in Logic and Computer Design Fundamentals, 4th Edition by Mano Syllabus Office Hours Web page

  2. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 2 Sequence of Electrical/Computer Engineering Courses at TCC EGR 271 (3 cr) Circuit Theory I ODU equiv: ECE 201 Offered: F, Sp, Su MTH 279 (4 cr) Differential Equations EGR 125 (4 cr) Into to Engineering Methods (C++) EGR 272 (3 cr) Circuit Theory II ODU equiv: ECE 202 Offered: F, Sp EGR 262 (2 cr) Fund. Circuits Lab ODU equiv: ECE 287 Offered: F, Sp, Su EGR 270 (4 cr) Fund. Of Computer EGR ODU equiv: ECE 241 Offered: F, Sp, Su Notes: Classes available at the Virginia Beach Campus, the Chesapeake Campus, and the Tri-Cities Center EGR 271-272 transfers to Virginia Tech as ECE 2004 EGR 270 transfers to Virginia Tech as ECE 2504 EGR 262 does not transfer to Virginia Tech

  3. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 3 Chapter 1 – Binary Systems Digital System – a system that works with discrete elements of information (a set of symbols) rather than with continuous signals as in an analog system. This discrete information is represented in binary form. Data processing is carried out by means of binary logic elements using binary signals. Quantities are stored in binary storage elements (memory). Illustration (analog system and binary system):

  4. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 4 Number Systems • 1. Decimal Numbers • Base = 10, ten unique digits: (0,1,2,3,4,5,6,7,8,9), place values, • counting sequence, examples, LSD and MSD • 2. Binary Numbers • Base = 2, two unique digits: (0 and 1), binary digit = “bit”, place values, counting sequence, examples, LSB and MSB

  5. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 5 Number Systems • 3. Octal Numbers • Base = 8, eight unique digits: (0,1,2,3,4,5,6,7), place values, • counting sequence, examples, LSD and MSD • 4. Hexadecimal Numbers • Base = 16, sixteen unique digits: (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F), place values, counting sequence, examples, LSD and MSD

  6. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 6 Arithmetic Operations Arithmetic operations in other bases are very similar to the familiar operations that we have always used in base 10. Examples – Addition (in several bases)

  7. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 7 Examples – Subtraction (in several bases)

  8. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 8 Examples – Multiplication (in several bases)

  9. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 9 Converting Between Bases 1. Converting to decimal: expand by place value as previously seen 2. Converting from decimal: A. For the integer portion: Use repeated division by the base (LSD is found first) B. For the fractional portion: Use repeated multiplication by the base (MSD is found first). Examples:

  10. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 10 • Converting between binary, octal, and hexadecimal – simple replacement • A) Binary to octal Examples:

  11. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 11 • Converting between binary, octal, and hexadecimal – simple replacement B) Binary to hexadecimal Examples:

  12. Chapter 1 EGR 270 – Fundamentals of Computer Engineering General Base 2 Base 10 12 (r-1)’s complement 1’s complement 9’s complement r’s complement 2’s complement 10’s complement • Complements • Complements are commonly used to represent negative numbers and to • perform subtraction. • There are two types of complements which can be applied to any base: where r = base And a general number X might consist of the digits X = aaaaaaa.bbb n = number of digits before the decimal point m = number of digits after the decimal point Formal definitions: (r-1)’s complement of X = rn – r-m – X ( = rn –1-X if m = 0) r’s complement of X = rn – X = (r-1)’s complement + r-m (= (r-1)’s complement + 1 if m = 0)

  13. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 13 Examples (using the formal definition): Shortcut approach to finding complements: 9’s comp: subtract each digit from 9 10’s comp: 9’s comp + 1 if m = 0 1’s comp: replace each 0 with 1 and replace each 1 with 0 2’s comp: 1’s comp + 1 if m = 0 2’s comp (alternate method): Move from the right until the first 1 is encountered. Complement each bit after (but not including) this 1. Examples:

  14. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 14 Representing negative numbers in 2’s complement form: Negative numbers are typically represented in 2’s complement form in computers or other digital systems. • Example: int variables in C++ are represented using two bytes, where the MSB is a sign bit. • If the MSB = 1, the number is negative and in 2’s complement form. • What are the max and min values that can be stored? • What happens when an overflow occurs? (Show a sample program) Example: Show how to represent +34 as an 8-bit signed binary number. Show how to represent -34 as an 8-bit signed binary number. If 10101010 is an-8-bit signed binary number, when decimal value does it represent? If 01100110 is an-8-bit signed binary number, when decimal value does it represent?

  15. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 15 How many bits are needed to encode a set of elements? In general, Binary Codes Digital systems use 2-state devices that understand only 2 binary values (0 and 1). But we communicate using various symbols and methods. Codes are needed to allow us to communicate. Codes translate our language into the computers language and vice versa. N bits are needed to encode up to 2N elements N = log2(number of elements)

  16. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 16 Examples: Determine the number of bits required and develop a code to encode each of the following: A) 8 symbols B) 10000 symbols C) the 366 days of the year in order D) the 366 days of the year using the month and day

  17. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 17 Recall the system of SI prefixes: kilobyte (kB): 210 = 1024 bytes megabyte (MB): 220 = 1024 kB = (1024)(1024) = 1,048,576 bytes gigabyte (GB): 230 = 1024 MB = 1,073,741,824 bytes terabyte (TB): 240 = 1024 GB petabyte (PB): 250 = 1024 TB etc byte: group of 8 bits word: an n-bit code forms n-bit words. In a computer system, a certain number of bytes may form a word. For example, a 16-bit system might refer to words as consisting of 2 bytes. Example: How many address lines (bits) are required in a computer that has 64 MB of RAM (random access memory)? Example: How many address lines (bits) are required in a computer that has 512 GB of RAM (random access memory)?

  18. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 18 Decimal Codes – codes used to encode the digits 0 – 9 Several examples are shown below (Table 1-5 from the text) The BCD code is the most common. Know the BCD code for tests. Other codes will be given if needed.

  19. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 19 Gray Code The Gray code is a 4-bit binary code (different from a BCD code in that it encodes all 16 4-bit combinations, not just 10 combinations). This code is interesting in that successive code words only change by one bit. This code is sometimes used with stepper motors. Each time the code increases, only one bit changes, and the stepper motor turns a specified amount (angle).

  20. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 20 Application: BCD codes are routinely used on equipment to display numerical values. Digital circuits work in binary, but people prefer to read numbers in base 10, so BCD codes are used to convert the data to base 10. Example: Show how a digital voltmeter would convert binary information into BCD format, including the use of binary-to-BCD converters and BCD-to-7-segment decoders.

  21. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 21 Error Detection and Correction Codes Extra bits are often added to codewords (using sometimes complex schemes) so that when the word is transmitted, the received can detect if errors occurred in the transmission and possibly correct some of the errors. Parity– perhaps the simplest error detection code involves the addition of a parity bit Discuss even parity vs odd parity Example: Show a BCD code with a trailing odd parity bit. Error Correction Codes - Discuss. Example: Show a simple 2-bit code with extra bits added for error correction.

  22. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 22 Alphanumeric codes Used to encode keyboard symbols and control characters. ASCII, EBCDIC, and Unicode are common alphanumeric codes. The ASCII code is shown below in Table 1-5 from the text. Since the ASCII code is a 7-bit code, a leading 0 bit or a parity bit can be added to form an 8-bit code (byte). Example: Write the word “Byte” using an ASCII code with an even leading parity bit.

  23. Chapter 1 EGR 270 – Fundamentals of Computer Engineering 23 • Alphanumeric codes • ASCII • 7 bits, 27 = 128 characters • With a leading 0, can be represented by 1 byte (two hexadecimal digits) • Example: 010000012 = 4116 = “A” • EBCDIC • 8 bits, 28 = 256 characters • Unicode • 16 bits, 216 = 65,636 characters • Can be represented by two bytes (four hexadecimal digits) • Provides support for international alphabets (and math symbols) • See text’s companion site for more information: www.prenhall.com/mano/ • The first 95 codes match the ASCII code with two leading hexadecimal digits • Example: 00000000010000012 = 004116 = “A”

More Related