Questions tagged [8-bit]

In computer architecture, 8-bit integers, memory addresses, or other data units are those that are at most 8 bits (1 octet) wide. Also, 8-bit CPU and ALU architectures are those that are based on registers, address buses, or data buses of that size. 8-bit is also a term given to a generation of computers in which 8-bit processors are the norm.

An 8-bit number has 2^8 = 256 possible states, 8 bits is one which is why computers with this architecture use bytes as a measurement of storage, for example you can have 64 gigabytes or 64000000000 bytes of memory (RAM).

Related tags:

215 questions
4
votes
1 answer

How to get 8 bit Colors?

So ,at this moment, I got a method which generates 3 random integers, from 0 to 255. I use the 3 integers for colors.Red, Green ,Blue. So,at this moment, if I want to set the color of something, with the generated colors, I use this: …
Vlad
  • 910
  • 1
  • 10
  • 18
4
votes
2 answers

Specifying 8bit immediate in x86-64 (GNU Assembler)

I'm trying to write some special routine in assembly, for x86-64 (even x86 example is fine). The problem: my immediates are only resolved at link time. For example, addq $Label2-Label1, %rax will add the difference between the two labels/symbols to…
kktsuri
  • 333
  • 2
  • 11
4
votes
2 answers

html5 canvas always returns 8bits of color when using getImageData()

I am using an html5 canvas to render and image, do some basic editing of the image than trying to use the getImageData(0 function to read through the pixels and do some work. I have notices thou, no matter what bit depth the source image is (8 bit,…
QBM5
  • 2,778
  • 2
  • 17
  • 24
4
votes
2 answers

Code works, but throws Incompatible Pointer Type warning

Trying things out as I learn C code, I wanted to test something. It worked as expected, but throws the warning Warning 1 assignment from incompatible pointer type [enabled by default] The code is simple. All I am doing here is toggling PIN B7 on…
Joey van Hummel
  • 400
  • 2
  • 12
3
votes
1 answer

fast multiplication of int8 arrays by scalars

I wonder if there is a fast way of multiplying int8 arrays, i.e. for(i = 0; i < n; ++i) z[i] = x * y[i]; I see that the Intel intrinsics guide lists several SIMD instructions, such as _mm_mulhi_epi16 and _mm_mullo_epi16 that do something like…
MWB
  • 11,740
  • 6
  • 46
  • 91
3
votes
1 answer

Can "swap nybble" and "byte mask" tricks do multi byte logical shift by 4 much faster than the naive method of using bit shift chains

I'm writing a fixed-point (16Q16) algo that does division using the Newton–Raphson method outlined on Wikipedia. (Related SE question HERE.) The first step requires logical right-shift by anywhere from 1-16 bits. My CPU is an 8-bit microcontroller,…
Charlie
  • 258
  • 2
  • 9
3
votes
0 answers

VHDL 8-bit adder with carry & testbench

Heyo! I've been trying to get into programming vhdl again for some upcoming classes and tried to do an simple 8-bit adder and wanted to test it with a testbench. (I'm working with the Vivado Xilinx Software btw~) I don't get any syntax errors, but…
nyoooom
  • 39
  • 1
  • 2
3
votes
1 answer

What type of interpreter were most 8-bit BASIC implementations?

I’m a big fan of early/mid 1980s personal computers like the Amstrad CPC, Commodore 64 and the Sinclair Spectrum. One thing these computers all had was a version of BASIC. As a language hacker myself I’m curious: were these interpreters implemented…
Garry Pettet
  • 8,096
  • 22
  • 65
  • 103
3
votes
1 answer

Two's complement function outputs wrong result for -1

I am generating the input for an FPGA program to use the trapezoidal integration method. Basically, the functions of interest here are the invert() and twos_comp() functions; the rest is just testing (creating a square wave signal, and then…
Auden Young
  • 1,147
  • 2
  • 18
  • 39
3
votes
2 answers

How to reduce weight's bit or change to lower bit's type in tensorflow by using MNIST?

I'm doing CNN model compression,and trying to reduce the weight's bit to get relation between bit's length and accuracy. But when I use Tensorflow Website's method to change the weight's Type of CNN,it came out an error : " TypeError : Value passed…
Aron
  • 31
  • 4
3
votes
3 answers

4x8 bit int to 32 bit integer

I have _int8 arr[0] = 0; _int8 arr[1] = 0; _int8 arr[2] = 14; _int8 arr[3] = 16; I need to convert it to one _int32 using as arr[0] as first part <..> and arr[3] as last. In the end it should be _int32 back = 3600; Should I use bit shifts or smth…
gemexas
  • 203
  • 2
  • 5
  • 10
3
votes
3 answers

How to convert 12 bit DICOM image to 8 bit jpeg?

I am trying to load DICOM files into python using the DICOM library. I have done the following ds=dicom.read_file(r"C:\Users\Z003SPFR.AD005\ML\GLCM AND SVM\data\NECT\1.IMA") # # store the raw image data DicomImage = ds.pixel_array This gives me…
Reshma
  • 51
  • 1
  • 4
3
votes
1 answer

what is the correct implementation of the 8-bit Fletcher algorithm in java?

i am trying to implement the 8-bit fletcher algorithm. I wrote a piece of code that does that but i am not sure if i understood the algorithm correctly. this is my piece of code: public class TestFletcher { public static void main(String[] argv) { …
user4559332
3
votes
7 answers

How can I plan my software to avoid excessive rewriting and interdependencies

I'm writing a motor controller that has a couple of interfaces (buttons, Bluetooth, haptic knobs) which is a task that is steadily growing to be a larger than I figured. I've tried to just go at it by starting with low-level modules (e.g. write…
Nick T
  • 25,754
  • 12
  • 83
  • 121
3
votes
1 answer

CA65 Segment Memory Map issue

I am working a 6502 project in CA65, and I am having trouble understanding some of the directives. What I want to do is have a segment defined as though it is in another part of memory, so that all of the addressing of that code is as though it was…
Speckpgh
  • 3,332
  • 1
  • 28
  • 46
1
2
3
14 15