Skip to content

Instantly share code, notes, and snippets.

View assyrianic's full-sized avatar
💻
CompEng courses

Kevin Yonan assyrianic

💻
CompEng courses
View GitHub Profile
@mbitsnbites
mbitsnbites / divu32.c
Created March 6, 2019 21:39
32-bit unsigned integer division (in C)
#include <stdint.h>
#include <stdio.h>
void divu32(uint32_t N, uint32_t D) {
uint32_t Q = 0;
uint32_t R = 0;
for (int i = 31; i >= 0; --i) {
Q = Q << 1;
R = R << 1;