In this video we'll explore some more advanced algorithms using Agner Fog's Vector Class Library. These are graphical examples, fractals, emulating HDR (High Dynamic Range), and a small teaser for an upcoming project which is a 64 bits per channel non-destructive image editor.
In this video we'll explore some more advanced algorithms using Agner Fog's Vector Class Library. These are graphical examples, fractals, emulating HDR (High Dynamic Range), and a small teaser for an upcoming project which is a 64 bits per channel non-destructive image editor.
OpenOffice: openoffice.orgIs this New Quadratic Formula Actually Faster than the OG Quadratic Formula? (For a Computer)Creel2022-08-31 | In this video we look at how well Po-Shen Loh's new quadratic formula compares to the original, tried-and-true Quadratic Formula in terms of speed. The new formula from Po-Shen Loh certainly looks simpler, but which is faster for a computer?
Gimp: gimp.orgAnswering Basic Assembly Language Questions - Assembly Language for BeginnersCreel2022-07-28 | In this video we answer several basic questions regarding x86/64 Assembly Language programming. The language has a steep learning curve, but once the fundamentals are understood, the whole journey becomes an exploration of the capabilities of a modern CPU. I have tried to keep things fairly simple, but even the basics in Assembly can be fiddly and difficult without clear step-by-step explanations of what is happening in the CPU. I hope this video helps people new to the language, as well as hints at some of the awesome power and flexibility of the language :)
0:00 - Intro 1:24 - Adding Two Numbers Together 4:41 - Finding the Smallest of two Numbers 14:24 - Count 1's in a 32 Bit Integer 16:18 - Sorting 3 Numbers in Ascending Order 16:57 - The Wrong Way 23:01 - The Right Way 27:22 - Outro
Gimp: gimp.orgObject Oriented Programming is a Dirty Rotten Low Down Trick: A Look at How C++ WorksCreel2022-06-04 | In this video we explore some of the techniques used by compiler authors achieve the mechanisms of Object Oriented languages. It is interesting to see how close C++ is to C, and how simple these mechanisms truly are under the hood. Although the video concentrates on C++, similar techniques are employed by the Java Virtual Machine, the .Net Virtual Machine in C#, and many other OO languages.
0:00 - Introduction 1:29 - Private member variables 6:26 - Member methods 11:38 - Polymorphism, Virtual Functions
'[OO] is a dirty rotten low down trick' is a quote by by Dr. Michael Brady from the lecture: Microprocessor Systems Lecture 1: youtube.com/watch?v=eG3Vg_EZTYk
Gimp: gimp.orgThat unbelievable function that can compute EVERYTHING! An Adventure in Discrete MathematicsCreel2022-03-31 | Well, this is a video all about 0's and 1's. Rather a lot of them really.
It's about universal operations and exploring how very simple sets of operations can be used to theoretically compute anything at all.
Addendum: I mention in the video that the NAND gates required for a video game or operating system would be comparable to Graham's Number. I am wrong, the number of NAND's required is faaaaaarrrrr less than that monster!! Thanks for the correction all :)
Background images from animations from HDRI Haven: hdrihaven.com
Software used to make this vid: Visual Studio 2019 Community: visualstudio.com/downloads (Came in mighty handy for spitting out truth tables, let me tell ya!)
In this video we explore 11 bit hacks from beginner to advanced beautifully rendered in 3D and to the music of Chopin.
0:00 - Intro 1:03 - Set a bit 1:53 - Clear a bit 2:45 - Toggle a bit 3:38 - Convert trailing 0's to 1 4:33 - Extracting the least significant 1 bit 5:43 - Masked copy 7:03 - Swapping bits 8:30 - Population count 10:07 - Counting bit islands 13:07 - Bit scan forwards 16:44 - Next lexicographic permutation
Sources for the algorithms: Stanford Bit Twiddling Hacks by Sean Eron Anderson https://graphics.stanford.edu/~seander/bithacks.html
This video is a little crash course on how to program a PIC microcontroller. I am using the PIC AS assembler, which is the newer version of the Microchip Assembler, and I will be programming using a PIC 12F675, though you can probably follow along with other mid-range devices.
We will be using MPLABX, and demonstrating many of the features which are useful when programming and debugging PIC microcontrollers.
Keep the above manuals handy whilst programming these devices! In addition to the above references, I recommend some great videos I have found on YouTube. The following list are videos I recall watching and enjoying, so have a watch if you like:
For a lot of great info and demonstrations regarding assembly programming (they use MP ASM), I'd recommend the excellent channel 'Circuit Bread': youtube.com/channel/UClKevSwDIU8NTyF2DAK0G0Q
Welcome to the (almost) Annual Computer Science Lockdown Quiz 2! This is a quiz about all things computer related! Good luck all, I hope you do well :)
Big thank you to Sam and Julzy for their awesome hospitality :)
!!! SPOILERS BELOW !!!
Media Info: J. S. Bach Brandenburg Concerto no. 2, mvt. 1; Columbia Chamber Orchestra, conducted by Reiner, Fritz. Source: https://www.liberliber.it/online/autori/autori-b/johann-sebastian-bach
Antonio Vivaldi "Winter" from "The Four Seasons", mvt. 1; United States Air Force Band, Air Force Strings. Source: Wikimedia Commons
Re-upload with fixed audio! Thanks for letting me know all :)
This video is in response to a question from a viewer. We explore hyperthreading and see how we can get the most out of it within our apps.
Thanks all, have a good one :)
Music: Mozart, W.A. Clarinet Concerto Mvt. 2 K. 622 University Symphony Orchestra; Abraham Kaplan, conductor; William McColl, basset clarinet, using an instrument of his own construction. soniventorum.com/soniventorum_archives.html
Background images from animations from HDRI Haven: hdrihaven.com
In this video we’ll look at some of the most complex instructions available in x86/64 Assembly language.
I have checked against the manuals from Intel and AMD and results from hardware, but it is almost impossible to create a video without any mistakes. Please test the instructions yourself before you apply them in code.
This video is all about an interesting algorithm commonly used in spell-checkers. It is called the Levenshtein Edit Distance algorithm and it determines the distance between two strings of symbols in terms of how many edits would be required to transform one string into another.
The source code and accompanying e-book are available on Patreon.
In this video we look at some misconceptions about Assembly language. Apologies for the sound in this one (and possibly the next too!), the main audio was not usable so I have used the camera mic instead.
In this video, we will run through 3 different ways to implement AVX512 in your C++ projects. Agner Fog's VCL, Compiler Intrinsics, and native Assembly language. The information in this video has all been covered in previous videos, but I wanted to include examples so folks that missed older videos can still explore AVX512.
In this video, we'll begin exploring Intel's latest and greatest instruction set, the amazingly colorful and ever perplexing AVX512! We'll briefly explore SIMD in general, followed by an overview of the AVX512 instruction sets themselves.
In this 3 part series, we will explore sorting algorithms from the fundamentals all the up to implementations of both a comparison sort and a base 256 Radix Sort.
In this 3rd and final part, we look at some code and compare the performance of RadixSort and QuickSort with lists of various sizes, consisting or randomly generated unsigned 32 bit integers.
Apologies for the code below, I have had to replace all greater or equal symbols with GE, and all less or equal with LE, greater is G and less is L. For the unedited version, please refer to the video!
Code: // Radix sort based on Geeks for Geeks: // geeksforgeeks.org/radix-sort static void RadixSort256(unsigned int* arr, int n) { if (n LE 1) return; // Added base case
unsigned int* output = new unsigned int[n]; // output array int* count = new int[256]; unsigned int* originalArr = arr; // So we know which was input
for (int shift = 0, s = 0; shift L 4; shift++, s += 8) { // Zero the counts for (int i = 0; i L 256; i++) count[i] = 0;
// Store count of occurrences in count[] for (int i = 0; i L n; i++) count[(arr[i] GG s)&0xff]++;
// Change count[i] so that count[i] now contains // actual position of this digit in output[] for (int i = 1; i L 256; i++) count[i] += count[i - 1];
// Build the output array for (int i = n - 1; i GE 0; i--) { // precalculate the offset as it's a few instructions int idx = (arr[i] GG s) & 0xff;
// Subtract from the count and store the value output[--count[idx]] = arr[i]; }
// Copy the output array to input[], so that input[] // is sorted according to current digit
// We can just swap the pointers unsigned int* tmp = arr; arr = output; output = tmp; }
// If we switched pointers an odd number of times, // make sure we copy before returning if (originalArr == output) { unsigned int* tmp = arr; arr = output; output = tmp;
for (int i = 0; i L n; i++) arr[i] = output[i]; }
delete[] output; delete[] count; }
Quicksort:
int Partition(unsigned int* data, int lo, int hi) { unsigned int pivot = data[lo + (hi - lo) / 2]; int i = lo - 1; int j = hi + 1;
for (;;) { do {} while (data[++i] L pivot); do {} while (data[--j] G pivot);
if (i GE j) return j;
// Swap [i] and [j] unsigned int tmp = data[i]; data[i] = data[j]; data[j] = tmp; } }
void QuickSort(unsigned int* data, int lo, int hi) { if (lo L hi) { int p = Partition(data, lo, hi); QuickSort(data, lo, p); QuickSort(data, p + 1, hi); } }
void QuickSort(unsigned int* data, int count) { if (count LE 1) return; // Added base case
In this 3 part series, we will explore sorting algorithms from the fundamentals all the up to implementations of both a comparison sort and a base 256 Radix Sort.
In this second video, we look at how counting sort, and then radix sort overcome the NLogN barrier and sort data in linear time!
In this 3 part series, we will explore sorting algorithms from the fundamentals all the up to implementations of both a comparison sort and a base 256 Radix Sort.
In this first video, we explore why Comparison Sorts have a speed limit: O(nLogn).
In this video, we look at the basic floating point SIMD instructions to achieve Addition, Subtraction, Multiplication and Division. This introduction includes both double precision and single precision, and the SSE, SSE2 and AVX instruction sets. I have included both the Assembly versions of the instructions as well as the C++ compiler intrinsics.
The following two references from Intel and AMD feature the hardware specifications for these instructions:
This video is an introduction to function pointers as used in C++ and C. We look at the basic syntax, and then run through examples of where function pointers are commonly used.
For a list of sources and inspiration for the code and information presented in this video, please see the end of this video description!
Stack Overflow – Many, many excellent questions and answers on this one! stackoverflow.com
The sources and inspiration for this video are numerous. I have tried to include all the sources I read in preparation for this video, but if you believe I have used an example from your text without appropriate attribution, please contact me on FaceBook or YouTube :)Branchless Programming: Why If is Sloowww... and what we can do about it!Creel2020-06-30 | Support What's a Creel? on Patreon: patreon.com/whatsacreel Office merch store: whats-a-creel-3.creator-spring.com FaceBook: facebook.com/whatsacreel
In this video we look at branchless programming. This is a technique to gain speed in our high and low level programming by avoiding branching code as much as possible.
This vid is just a fun quiz based on computer science and computers in general.
Images are from Wikipedia, except for: HD Floppy Disk: http://res.freestockphotos.biz/pictures/1/1769-closeup-of-blank-floppy-disc-pv.jpg Sound from final question from SoundBible: http://soundbible.com
This is the second video in a series on Set Associative Caches. This video is a commentary on the caches used selected in AMD and Intel CPU's over the years, including Ryzen and i9's released at the end of 2019 and beginning of 2020.
This is the first video in a 2 part series discussing Set Associative Caches. These are the types of caches on AMD and Intel CPU's. In this video, we look at how a set associative cache works, and explain the numbers set associativity, cache line size, tag, offset and index. Showing how the CPU addresses RAM, and stores cache lines in a set associative cache.
OpenOffice: openoffice.orgModern x64 Assembly 15: Introduction to SIMDCreel2020-04-24 | In this video we take a look at SIMD: Single Instruction Multiple Data.
HDRI backgrounds in the 3D animations from HDRI Haven: hdrihaven.comExploring Cliques and Clique ProblemsCreel2020-03-30 | In this video we'll explore a collection of interesting problems, collectively involving the concept of Cliques. A clique is a collection of nodes which are all connected together. For example, in FaceBook, a collection of people who are all friends with each other. It is fascinating to explore Cliques because they represent some of the simplest forms of the P vs NP problem.
Source code is not yet available. I will update this description when it is uploaded. Thanks for watching all!
OpenOffice: openoffice.orgASM Tricks Bonus Vid: C++ Calling Member MethodsCreel2020-03-25 | In this video we look at how we can call C++ member methods from our Assembly code. The main tricks involved here are getting the actual name of the function (the name will usually be mangled by the compiler), and then being careful to ensure the first parameter is a pointer to the object, the *this pointer.
Gimp: gimp.orgModern x64 Assembly 14: Structures in ASM and C++Creel2020-03-22 | In this video, we'll look at structures in Assembly and C++. We'll explore how C++ represents its structures in RAM, and how to access members. As well as C++ classes, and how to access members, even if they are private members!
OpenOffice: openoffice.orgAre CPUs Getting Faster? (2009 AMD Phenom II vs 2018 Intel i7 8750H - Phenom 2 Benchmark)Creel2019-12-29 | In this video we explore the question of whether modern CPU's are faster than older ones. Specifically, how does an i7 from 2018 compare to a Phenom 2 from 2009.
Download the benchmark from github below, test your own system against the fiery Phenom II. Leave a comment of your results, and please leave a thumbs up to support this channel. Thank you, have a good one :)
Davinci Resolve 16: blackmagicdesign.com/products/davinciresolveThe Sorting Algorithm Olympics - Who is the Fastest of them AllCreel2019-11-28 | In this video, we race 7 sorting algorithms against each with lists of varying sizes. This is meant to demonstrate the different strengths of various algorithms, and show which you would be best using when given data sizes to sort.
I have included the Patreons that made this video possible below. Thank you for your support mates :)
Software used to make this vid: Visual Studio 2019 Community: visualstudio.com/downloads Synfig: synfig.org Gimp: gimp.org Audacity: audacityteam.org OBS: obsproject.com Davinci Resolve 16: blackmagicdesign.com/products/davinciresolveModern x64 Assembly 13: Control Structures (If statements, do while, while and for loops)Creel2019-11-21 | In this video, we'll look at control structures, and how they look in both C++ and Assembly. We will look at basic If Statements, branchless programming with CMOVxx instructions, While, Do/While and For loops. As well as a little at the regular ASM loop, which is something like a do while loop.
Davinci Resolve 16: blackmagicdesign.com/products/davinciresolveNeural Nets 6: Activation FunctionsCreel2019-11-20 | In this video, we'll explore activation functions. What they are, why they're used, and then we'll implement 3 of them along with their derivatives in our Neural Net library.
Thank you Bob and Trish, for lending me your living once again :)
Davinci Resolve 16: blackmagicdesign.com/products/davinciresolveGodbolt Compiler Explorer AdventuresCreel2019-09-29 | In this video I want to share a really fun and extremely interesting website. It's called the Godbolt Compiler Explorer! Really, an amazing, fun website for C++ and C coders who are interested in modern optimizing compilers, and Assembly language.
Sorry, but I accidentally specified the MS compiler's AVX2 flag wrong, so it didn't AVX2 anything... :( Anywho, here are the compiler settings I was using for each compiler (with the amended MS AVX2 flag):
Meshroom: alicevision.github.ioAgner Fogs VCL (Vector Class Library Installation and Overview)Creel2019-09-24 | In this video we'll look at installing Agner Fog's VCL (Vector Class Library). We look at installing the library, as well as an overview of the vector types, SIMD, and how to use the library. The library provides a convenient method for high performance SIMD vectors, including SSE2, AVX and AVX512, without ASM or intrinsics.
Davinci Resolve 16: blackmagicdesign.com/products/davinciresolveNewtons Method: How to Compute Pretty much AnythingCreel2019-08-31 | In this video we'll explore Newton's Method. It is a technique for solving equations of a single variable. It is very widely used, and extremely powerful.
Meshroom: alicevision.github.ioNeural Nets 5: Forward Propagation (Feed Forward)Creel2019-08-29 | In this video, we'll implement the forward propagation step. This is where the Neural Net takes the data in the input layer, and pushes it through the layers, in order to compute the result. We still have no input, and we need to apply the activation function.
Meshroom: alicevision.github.ioIntro to Rust Programming Language (Installing guide, cargo and simple examples, vs C++)Creel2019-08-11 | In this video we look at how to install the Rust tool chain, RustUp-Init, compiler, and Rust's package manager Cargo. We also look at some small programs, and one interesting quirk (i.e. variables are immutable by default).
Meshroom: alicevision.github.ioNeural Nets 4: Adding Layers Explained (Deep Learning)Creel2019-08-10 | In this video, well create and add the layers to our neural net classes. This is a video about how layers work in Deep Learning Neural Nets.
Thank you to Patrons past and present: Alexander Dahlin, Alve Larsson, Andy Torres, Anthony Van de Gejuchte, Augusto Righetto, Awon Ali, Blaz, Carsten Hansen, Chris Lidyard, Christer Borgqvist, Curtis Seizert, Darby Burbidge, Dominik Wyss,Dorin,Floris Bob van Elzelingen,Geert Depuydt,Gurpreet Singh,James Mearns,Jeffrey Knuckle,Josef Aguilar,Joshua Smyth,King Gore,Lukas Waymann,Luke Duguid,Martin Champagne,Martin Cohen,Matheus Salvia,Matthew Livernoche,Micah Rust,Mr. Penguin,Parker Lai,Patreonic,Peter B,Renwick Preston,Robert Jacobson,Roman Kozak,Ross Young,Steffen André Langnes,Taylor,Thomas,Todd Cullum,Tsuki Zombina,Wathinti Abafazi,William Allen,Yichao Shen,Zhixun He
Special Cheers for amazing contribs: dominic pace Cato Larsen and Michael Pearce
Open Office 4: openoffice.orgC++ Magical History Tour: Formative YearsCreel2019-07-31 | In this video, we take a small adventure through the early mechanisms included in the precursor to the C++ language. Initially, Bjarne made a language called C with classes. This eventually led to the C++ language in the early 1980's.
Meshroom: alicevision.github.ioMatrix Multiplication in C++ (for Neural Networks)Creel2019-07-24 | In this video we code the matrix product in C++. It is important that we have a working Neural Network library before we worry about performance coding.
We also code the Hadamard product, element-wise addition and subtraction. We will use all of these methods when we implement Forward and Back propagation.
Meshroom: alicevision.github.ioNeural Net Structure (Architecture)Creel2019-07-14 | In this video, we code the class structure for a Neural Net library. It is designed to make the interface as simple as possible. My idea is to completely remove all "for" loops from the library except in the number crunching Matrix class.
Meshroom: alicevision.github.ioIntroduction to Neural Networks (AI vs Biological Neural Nets)Creel2019-06-30 | In this video we'll look at neural networks. We'll cover the basics of biological neural networks, then look at the theory behind artificial neural networks, before introducing the main mechanism behind real high-performance artificial neural networks.
If you want to support this channel and/or project jump over to Patreon: patreon.com/whatsacreel
Meshroom: alicevision.github.ioStudying Agner Fog 2: Unrolling Loops and Dependency ChainsCreel2019-06-17 | In this video we'll cover techniques to break dependency chains, and how to unroll a loop. We explore two different algorithms; summing an array of doubles, and then computing the Standard Deviation of a floating point array. We look at versions in both C++ and Assembly language.
Cheers to Agner Fog for his amazing work, and for his kind review and suggestions in the final edit :)
ASM Dude VS 2017 Extension: marketplace.visualstudio.com/items?itemName=Henk-JanLebbink.AsmDudeModern x64 Assembly 12: C Calling Convention (Passing Parameters)Creel2019-04-21 | In this video, we look at how to pass integer, pointer and floating point parameters to ASM. And where to place them so that C++ will read them as return values from a function. Basically, we use RCX, RDX, R8 and R9 for integer and pointer parameters; and XMM0 to XMM3 for floating point.
I really picked a terrible spot to record this one. I will try not to record in the wind again. I am trying to get into a more regular upload schedule. Sorry in advance if the audio is difficult to hear.
This vid is an answer to a comment from Belgian Geek. If you watch it mate, I hope it's of some help :)
Renoise (for it's amazing hi pass filters and EQ; it aint free but it's really, really good! renoise.comModern x64 Assembly 11: Division with the DIV and IDIV InstructionsCreel2019-04-19 | This video is on the DIV instruction. This instruction is used to divide unsigned integers. It is interesting because it computes not only the division, but also the remainder after division. DIV is also interesting because it (and it's signed, sister instruction IDIV) have implied input parameters, and output parameters.
ASM Dude VS 2017 Extension: marketplace.visualstudio.com/items?itemName=Henk-JanLebbink.AsmDudeModern x64 Assembly 10: Conditional Jumps, Moves and Set ByteCreel2019-04-08 | Hiya all, this new vid is on conditional instructions; conditional jumps, conditional moves and the set byte instructions. They all use the same condition codes, and so I tried to relate them by presenting them together. These instructions all perform certain actions (i.e. jump, or move data) based on the bits in the rFlags register. They are how we instruct the CPU to act on the flags.
ASM Dude VS 2017 Extension: marketplace.visualstudio.com/items?itemName=Henk-JanLebbink.AsmDudeModern x64 Assembly 9: The rFlags Register (Flags, pushfq, popfq, pushf, popf)Creel2019-03-17 | This video we'll look at the flags register. It's used for branching, conditional moves, and conditionally setting bytes.
ASM Dude VS 2017 Extension: marketplace.visualstudio.com/items?itemName=Henk-JanLebbink.AsmDudeStudying Agner Fog: Intro and Static Local ArraysCreel2019-03-01 | In this video, I want to introduce the work of Agner Fog, a computer scientist who has written and made available some really great information on the topic of performance programming x86/x64 CPU's. If you aint got his manuals and you code x86 ASM, go and check them out, they're really indispensable! Links below.
This video is my own work, and if there's mistakes, it's very likely they are my own! It's also likely the love story between VIA and Cyrix, and conversation between Intel and AMD are largely, if not entirely, fictional.
Still working on production flow. This one's got a new green screen. It kinda works, and kinda not. Anywho, hopefully this video can be the start of many based on the optimization techniques presented in Mr. Fog's manuals.