Lecture Slides on Computer System Design unit 1
char 1 1 1 short
Download 293.03 Kb.
|
SOC2040 SP WEEK 3 LECTURE SLIDES ON DATA REPRESENTATION SPRING 2023
- Bu sahifa navigatsiya:
- SOC 2040 SYSTEM PROGRAMMING
- General Boolean Algebras
- Example: Representing Manipulating Sets
- 0x41 ➙ 0xBE (HEX)
- 011010012 | 010101012 ➙ 011111012 (BINARY)
- Contrast: Logic Operations in C
DATA SIZES (in Bytes) SOC 2040 SYSTEM PROGRAMMINGWEEK 3 LECTUREBIT LEVEL MANIPULATIONSBit Level Manipulations
Bitwise and &
Bitwise Or |
Bitwise not ~
Bitwise Exclusive-Or (Xor) ^
General Boolean Algebras
01101001 & 01010101 01000001 01101001 | 01010101 01111101 01101001 ^ 01010101 1100 ~ 01010101 10101010 01000001 01111101 00111100 10101010 Example: Representing & Manipulating Sets
of 01010101What is X^X ? Bit-Level Operations in C
~0x41 ➙ 0xBE (HEX)~010000012 ➙ 101111102 (BINARY)~0x00 ➙ 0xFF (HEX)~000000002 ➙ 111111112 (BINARY)0x69 & 0x55 ➙ 0x41 (HEX)011010012 & 010101012 ➙ 010000012 (BINARY)0x69 | 0x55 ➙ 0x7D (HEX)011010012 | 010101012 ➙ 011111012 (BINARY)Contrast: Logic Operations in C
Contrast: Logic Operations in C
Watch out for && vs. & (and || vs. |)… one of the more common oopsies in C programming Contrast: Logic Operations in CGiven x = 0x4C and y = 0xB3, Compute the following showing all steps (i) x && y = (ii) x & y =
= 0x4C && 0xB3 = 0x01 && 0x01 = true && true = true = 0x01 = 1 Where true = 0x01 = 1 false = 0x00 = 0 (ii) x & y = 0x4C & 0xB3 = 01001100 & 10110011 = 00000000 = false = 0x00 = 0 Where true = 0x01 = 1 false = 0x00 = 0 01001100 & 10110011 00000000 SOC 2040 SYSTEM PROGRAMMINGEND OFWEEK 3 LECTURE 2DATA REPRESENTATIONWISH YOU ALL THE BESTSOC 2040 SYSTEM PROGRAMMING Reading Assignments Chapter 2 of Text Book
- Randal E. Bryant and David R. O’Hallaron 3rd Edition, Global Edition Prentice Hall 2016 ISBN 10:1-292-10176-8 INHA UNIVERSITY TASHKENT SPRING SEMESTER 2023 SOC 2040 SYSTEM PROGRAMMING CREDITS/HOURS PER WEEK : 3/3 COURSE TYPE : TECHNICAL CORE SEQUENCE INSTRUCTOR DR. A. R. NASEER HEAD & PROFESSOR OF COMPUTER SCIENCE & ENGGDownload 293.03 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling