Codility BinaryGap Solution in C++

Short Premise Find the maximum consecutive zeros that are surrounded by ones in the binary representation of a number N in a range between 0 and 2.147.483.647. Approach The approach to this solution is to build a state machine that can process the language generated by zeros and ones in a binary number and count the size of all zero gaps. The maximum gap should be computed from all gap values. [Read More]

What is and how to create a Linux Kernel Module

Introduction This article is a basic explanation of what is and how to create a Linux kernel module. The Linux Kernel As we know the Linux kernel is an open-source, monolithic, soft preemptive UNIX like operating system partially compatible with POSIX specification. The Linux kernel is widely used in specific and general purpose applications. The Monolithic Kernel Wolfgang Mauerer (2016)1, in his book Professional Linux Kernel Architecture, says that a monolithic kernel is on that: [Read More]

Enabling pthread in your C++ Verilator Testbench

Form multiple reasons you could need a verilator simulation using multi-threading in C++. This article is a simple tutorial on how to create a simple multi-threaded ready project using Verilator. In this project i gonna use Ubuntu 18.04. Download and build latest verilator version First of all you should build the latest version from veripool git repository, once the distro package won’t supply the latest stable version. In Ubuntu 18. [Read More]

A Verilog Implementation of Combinational Multiplier based on Ancient Egyptian Algorithm

This algorithm is a combinational implementation of peasant algorithm. The peasant algorithm is based on an ancient Egyptian technique written in the seventh century B.C. by the scribe Ahmes1. Despite the inexistence of the base two’s concept, the algorithm is essentially the same as modern computers use to make fast multiplications. Sometimes, this algorithm is called Egyptian, sometimes is called Russian peasant algorithm. Besides the pedagogic effectiveness of concrete constructions, and equally correct, as a friend of me did in this blog post, I dislike them. [Read More]

Docker Image for OpenCV development

OpenCV is an Open Source Computer Vision Library released under BSD license and can be used to academic and commercial use. It has various languages interfaces that supports multiple operating systems1. Multiple computer vision algorithms are implemented in OpenCV and it is being actively being developed by a very large comunity 1. Usage ranges from interactive art, to mines inspection, stitching maps on the web or through advanced robotics. [Read More]