Week 9 Day 1 - Hex & Octal, Image Processing, NEON
Today we talked about the usefulness of hex and how to convert to and from binary (as well as other formats), and a bit on octal. Hex digits are groups of four bits, and octal digits are groups of three bits. As such hex digits range from 0 to 15, i.e. 0 to "F"... A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15. Octal digits range from 0 to 7.
You write a hex number like this 0xFFFF0000. (The 0x prefix means it is a hex digit, not decimal. It certainly doesn't mean multiply by 0!) 0xFFFF0000 means 16 1's followed by 16 0's in binary. A 32 bit number in hex is therefore only 8 digits, instead of 32. Makes dealing with binary numbers a lot easier.
An octal digit is written with a leading 0, like this: 052. 052 in octal means 42 in decimal. Why? Because the last digit is the 1s digit, so it contributes two points to the total. The 5 is in the 8's digits place, so it contributes 40. Therefore, 40+2 = 42.
We then talked about image processing. An image file (at least the way we're doing it) is a 3D array of unsigned chars, ranging from 0 to 255. The first plane holds all the red values, the second plane holds all the green values, the third plane holds all the blue values. Your job for this assignment is to halve all the values, the next one will be more complicated.
We then went over more examples of how to use NEON to do SIMD processing.
Other Videos By Bill Kerney
2021-03-16 | Week 9 Day 1 - Algorithms |
2021-03-15 | Week 10 Day 1 - BSTs Part II |
2021-03-13 | Extra Credit Workshop: Sea Shanties |
2021-03-13 | Week 8 Day 3 - Quantifier Fallacies and Cognitive Biases |
2021-03-12 | Week 9 Day 3 - Binary Search Trees |
2021-03-12 | Week 9 Day 2 - Matrix Multiplies and Interactivity |
2021-03-11 | Lecture 9 Day 2 - Floating Point Numbers |
2021-03-11 | Week 8 Day 2 - Online Privacy |
2021-03-10 | Week 9 Day 2 - File I/O with Classes and NCURSES Programming |
2021-03-09 | Week 9 Day 1 - Matrix x Vector, Traceline |
2021-03-09 | Week 9 Day 1 - Hex & Octal, Image Processing, NEON |
2021-03-09 | Week 8 Day 1 - Corporate Censorship |
2021-03-08 | Week 9 Day 1 - How to UNIX |
2021-03-06 | Week 7 Day 3 - Is/Ought |
2021-03-05 | Lecture 8 - Procedural Generation |
2021-03-05 | Week 8 Day 3 - Deques, Pairs, Tuples |
2021-03-04 | Week 8 Day 2 - Cross Product |
2021-03-04 | Week 8 Day 2 - SIMD |
2021-03-04 | Week 7 Day 2 - Modal Logic |
2021-03-03 | Week 8 Day 2 - Memory Leaks, RPG 41 |
2021-03-02 | Week 8 Day 1 - Dot Products |